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

algorithm to find the total number of ways to reach the last layer from the initial one of a directed graph

I want an algorithm to find the total number of ways to reach the last layer from the initial one of a directed graph whose last and first layers contain only one node .Please suggest which algorithm should i use .
ZaidRehman
  • 1,631
  • 2
  • 19
  • 30
0
votes
2 answers

Connected vs Strongly cnonected Directed Graph

Give a graph: Input: 0 -> 1 2 -> 1 3 -> 1 Representation: 0 -> 1 <- 2 ^ | 3 This graph is not strongly connected because not every vertex u can reach vertex v and vice versa (path u to v and v to u) The algorithm I am currently…
0
votes
1 answer

Performant Graph algorithm to find path from node to root in a directed graph

I have a directed graph with a special root node from which all other nodes are reachable. It is quite easy to find an arbitrary algorithm to find all pathes from a giving node to the root, for example this solution (DFS) using LinkedHashSets. Well,…
Klaus Schulz
  • 527
  • 1
  • 5
  • 20
0
votes
1 answer

Appending multiline text to nodes in directed graphs in d3js

I am trying to create multi line text as nodes of the directed graph as : Donovan
codegenx
  • 23
  • 1
  • 8
0
votes
1 answer

How to use declared variables in html section?

I'm trying to build a directed line graph in D3 with the ability to use a linear scale in D3 with domain [-1,0,1] and range ["red","yellow","green"] to set the color of edges as a representation of speed between nodes. I am new to D3, JS, and…
aschaefer
  • 35
  • 1
  • 1
  • 7
0
votes
0 answers

implement Dijkstra in C++ to find shortest path for every vertex of a directed graph

I am trying to implement the Dijkstra algorithm in c++ code that find the shortest for the graph from a text file. The text file contain a matrix that represent a directed graph. Dijkstra algorithm find the shortest path from the source vertex to…
snow2462
  • 1
  • 2
0
votes
1 answer

js library for directed acyclic graphs with drag and drop support

I'm looking for a js graphing library that supports creating directed acyclic graphs using drag and drop. The UI would have a canvas with a list of elements that can be dragged onto the canvas to create a directed acyclic graph. Objects have labels…
0
votes
2 answers

directed unweighted graphs C

I'm planning to write a program in C that builds the adjacency list, performs the depth first search, performs the breadth first search, and performs the topological sort. Where can I get some info about this subject in C? Any help is appreciated…
fang_dejavu
  • 625
  • 2
  • 15
  • 22
0
votes
1 answer

Building a Graph with Directed Edges in R

I have a Dataset which looks like this: PostID UserID ReplyTo 1 11 NA 2 12 1 3 11 2 4 13 NA 5 12 4 I want to have a directed Graph with the Edges: 12->11, 11->12, 12->13 The Idea is that ad the End i'm…
Carlo
  • 397
  • 1
  • 3
  • 14
0
votes
1 answer

Creating a graph and finding strongly connected components in a single pass (not just Tarjan!)

I have a particular problem where each vertex of a directed graph has exactly four outward-pointing paths (which can point back to the same vertex). At the beginning, I have only the starting vertex and I use DFS to discover/enumerate all the…
0
votes
2 answers

D3 js Force Directed Graph - highlight path between two points

I am using the following force directed example for one of my project. Example Link Here, I need something like: - Highlight the paths between "Microsoft" and "Sony". Is it possible ? Please help me.
Aneesh
  • 1,193
  • 3
  • 16
  • 26
0
votes
1 answer

Dynamic programming graph algorithm

I am currently learning dynamic programming and i can't figure this problem out. Could someone give me an algorithm for it? : Consider a directed graph G = (V,E) where each edge is labeled with a character from an alphabet Sigma, and we designate a…
user2971971
  • 183
  • 6
  • 11
0
votes
0 answers

D3 Force Layout - Custom collapse, uncollapse

I am using d3's force layout to create a custom collapse mechanism where the nodes collapse towards the parent node and are arranged in a cluster behind it. THis is using the normal FOrce layout with a JSON having nodes and links. I have managed to…
0
votes
1 answer

Is there a class in networkx 1.8 which encapsulates tree assertions in node add/remove operations

I searched now for an hour for an answer to this trivial question (trivial for those who know) in an actually well written documentation (citations of papers, not one bit undocumented). Let me show you what I found so…
Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
0
votes
1 answer

Directed graph matrix visualization using JS

I tried to visualize a directed graph to matrix using protovis matrix. By default protovis matrix fills 2 blocks in matrix if A->B. I want to fill only one block as per the direction between 2 nodes. If A->b and B->A then only both blocks should be…
Amit Kumar Gupta
  • 7,193
  • 12
  • 64
  • 90