Questions tagged [directed-graph]

A directed graph is a set of objects (called vertices or nodes) that are connected together, where all the edges are directed from one vertex to another. A directed graph is sometimes called a digraph or a directed network.

A directed graph (or digraph) is a , or set of nodes connected by edges, where the edges have a direction associated with them

686 questions
0
votes
1 answer

Finding cycles in weighted directed multi graph (Gephi, Jython, Python)

I have a directed, multi, weighted graph. I want to find cycles where a -> b -> c -> a A sample of my graph. I hope it it clear: v1 -> v2 v2 -> v3 v3 -> v1 v1 -> v4 v2 -> v5 How to iterate only nodes that are targets? This is my shor results =…
Aidis
  • 1,272
  • 4
  • 14
  • 31
0
votes
1 answer

Finding invert pair of a cell pair in excel

I have a table that is an image of directed graph. John, Peter John, Dan Peter, John Dan, John How to arrange rows in a such way that pairs would appear next to each other. The result should look like: John, Peter Peter, John (this gap is…
Aidis
  • 1,272
  • 4
  • 14
  • 31
0
votes
1 answer

d3.js collapsible force layout with all the nodes collapsed

I've been trying to implement a directed force layout using a json file that I've written. Before I tried to make it begin with all nodes collapsed, it was working properly. I've declared a property called "index" for all the nodes, indicating which…
user3154169
  • 1
  • 1
  • 4
0
votes
0 answers

Visual Graph Traversal in C#

I'm working on a homework assignment, in which I have to traverse a map of Paris (png format) to navigate between 15 different landmarks. I need to be able to start navigation from any point on the map, and reach the landmarks in a user defined…
Max Hampton
  • 1,254
  • 9
  • 20
0
votes
1 answer

code simplification for cycle detection in directed graph in Java

I have this following code which works fine to detect cycles in directed Graph. something I do not like here is return true appearing in conditional statement if (!t.isVisited && isCyclicDirected(t)). I am returning true whether or not the if…
brain storm
  • 30,124
  • 69
  • 225
  • 393
0
votes
1 answer

Program that takes encoded directed graphs and draws them graphically?

So I have some encoded directed graphs in the form: (1,2,3,4),((1,2),(2,1),(3,4)) So just basic list of nodes and then a list of edges. Is there a program that will let me pipe in a string like that and draw it, so I don't have to draw the graph…
user1086516
  • 887
  • 3
  • 9
  • 21
0
votes
1 answer

code for cycle detection is not finding returning the right number of cycles in directed graph in Java?

I have code written for calculating the no of cycles in a directed graph using DFS. The method to check if a cycle exists or not works fine. I now iterate through all the vertices (which I have in a HashMap) and check if a vertex is unvisited, then…
brain storm
  • 30,124
  • 69
  • 225
  • 393
0
votes
2 answers

Will SCC pattern change if we reverse a graph(using Kosaraju's Algorithm)?

Assume we have a digraph, it is not a complete graph and has more than one SCC. I wonder if the patterns of Strongly Connected Component changes if we transpose the graph and use Kosaraju's Algorithm? By saying "transpose the graph" I mean flip the…
0
votes
1 answer

can I have a directed cyclic graph with just two vertexes?

Is this a legal cyclic directed graph? It has only two nodes. A ---------> B <--------
eagertoLearn
  • 9,772
  • 23
  • 80
  • 122
0
votes
1 answer

graph adjacencies definition for directed graph to implement Dijkstra algorithm in Java?

I am implementing the code to get the shorted path in a directed graph as shown below using Dijkstra's algorithm? my question is how to define the adjacency list for a vertex? in my current code below, I have considered only the outgoing edges to…
brain storm
  • 30,124
  • 69
  • 225
  • 393
0
votes
1 answer

worst running time for finding SCC using DFS Kosaraju

Kosaraju's algorithm states the following: #Input is graph G 1-define G_rev (links in reversed order) 2-Find the finishing times for G_rev using DFS 3-Run DFS for G in sequence based on finishing time The running time is O(n+m) where n is the…
andreSmol
  • 1,028
  • 2
  • 18
  • 30
0
votes
2 answers

How to declare two structs which have members of the others type?

I am trying to make a directed graph, So I made a Graph class and it has a private edge struct and a private node struct. I would like my edges to have a node member which is the node that the edge points to, and I would like my nodes to have a list…
Loourr
  • 4,995
  • 10
  • 44
  • 68
0
votes
2 answers

Adjacency Matrix -> Directed graph -> DFS

This is the code my friends and I have come up with so far after fiddling around. What we are trying to do is read in the adjacency matrix (input.txt), then create a directed graph out of it so we can search it using Depth-First Search. We want the…
0
votes
1 answer

how does one predict edges / links / connections on a weighted directed graph network?

Given an adjacency matrix A for a weighted, directed graph (so matrix elements are not just 0/1 and the matrix is not symmetric), are there any good methods for predicting new edges? I have a VERY large (billions of nodes) dataset with known edges…
Glenn Strycker
  • 4,816
  • 6
  • 31
  • 51
0
votes
0 answers

Java Exception while reading a text file

back with new features in 'file.txt' are these lines: [noduri1] {x0;140;104;31;50;} {x1;361;132;55;50;} [arce1] {a0;160;143;386;173;0;1;} [noduri2] {x2;192;82;27;50;} {x3;174;263;27;50;} [arce2] …