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
5
votes
1 answer

Computing nearest vertex neighbors in a DAG completed by transitive-closure

Consider a directed graph, like this: Where, (A) initially, the solid black edges are asserted: 0 → {1,3} 1 → {2} 3 → {4} 4 → {2} Then (B) the transitive closure has then been computed to add the…
user206428
5
votes
1 answer

Pre and post numbers

When doing a depth first search on a Directed Graph what is meant by pre and post numbers? For example: If you were to start at node A and do an alphabetic Depth First Search how do you determine the pre and post numbers?
Deekor
  • 9,144
  • 16
  • 69
  • 121
5
votes
1 answer

Python networkx and persistence (perhaps in neo4j)

I have an application that creates many thousands of graphs in memory per second. I wish to find a way to persist these for subsequent querying. They aren't particularly large (perhaps max ~1k nodes). I need to be able to store the entire graph…
easytiger
  • 514
  • 5
  • 15
5
votes
1 answer

D3 Directed graphs

I have used the following example to generate directed graphs http://bl.ocks.org/1153292 I want to add a click event so that when the user clicks on a node, the heading of the node is displayed So far i did this var circle =…
5
votes
2 answers

What does the 'lower bound' in circulation problems mean?

Question: Circulation problems allow you to have both a lower and an upper bound on the flow through a particular arc. The upper bound I understand (like pipes, there's only so much stuff that can go through). However, I'm having a difficult time…
Wander Nauta
  • 18,832
  • 1
  • 45
  • 62
4
votes
2 answers

What is the name of this type of directed acyclic graph?

Perhaps it isnt even a DAG, but as its naming im after i wasnt sure what title to give this... What is the name of a data structure where every node can only have 0 or 1 paths INTO it? Strictly, is this a tree? Thanks
Andrew Bullock
  • 36,616
  • 34
  • 155
  • 231
4
votes
8 answers

Finding Successors of Successors in a Directed Graph in NetworkX

I'm working on some code for a directed graph in NetworkX, and have hit a block that's likely the result of my questionable programming experience. What I'm trying to do is the following: I have a directed graph G, with two "parent nodes" at the…
Fomite
  • 2,213
  • 7
  • 30
  • 46
4
votes
2 answers

Reproduce same graph in NetworkX

I would like to improve my graph. There are problems as follow: how to create a consistent graph.the graph itself is not consistent everytime i execute / run the code, it will generate different images. The inconsistent graph is shown in the…
amj
  • 55
  • 4
4
votes
4 answers

How to efficiently create interactive directed network graphs (with arrows) on Python?

In order to construct a directed network graph, Plotly's current approach seems to be using annotations. This works when there are few edges and one can manually populate each one through the figure layout, e.g., this example. But if I'm creating a…
aspire
  • 155
  • 1
  • 1
  • 9
4
votes
1 answer

ArangoDB Creating counter edge for every directed edge for bidirectional edges

I am very new to graph database. And I have started with Arango. For this project I am not sure about the queries that I will encounter in future. I don't want to create bottlenecks. So I wanted to create undirected or bidirectional edges…
Neel Basu
  • 12,638
  • 12
  • 82
  • 146
4
votes
1 answer

Obtain weight of a path with iGraph in R

I have a graph I created from a data frame, in the form of from, to, cost columns. I also have a path (as a succession of vertexes, in the vpath format of igraph) which is valid (my graph is directed). Is there any function that, given my graph and…
Carrol
  • 1,225
  • 1
  • 16
  • 29
4
votes
1 answer

networkx DiGraph Attribute Error self._succ

Context: I'm trying to run another researcher's code - it describes a traffic model for the Bay Area road network, which is subject to seismic hazard. I'm new to Python and therefore would really appreciate some help debugging the following…
Gitanjali
  • 127
  • 3
  • 9
4
votes
1 answer

Is it possible to change node size of a pydot graph?

I wrote a code to convert my MultiDiGraph() to a pydot graph to display self loops and arrows but after conversion, the pydot graph A has lost all the attributes of G. How can change the node size of graph A and set them equal to corresponding value…
Silvi Mantri
  • 41
  • 1
  • 3
4
votes
2 answers

What is the best data structure and algorithm for comparing a list of strings?

I want to find the longest possible sequence of words that match the following rules: Each word can be used at most once All words are Strings Two strings sa and sb can be concatenated if the LAST two characters of sa matches the first two…
devoidfeast
  • 829
  • 3
  • 12
  • 22
4
votes
2 answers

How to detect cycles in directed graph in iterative DFS?

My current project features a set of nodes with inputs and outputs. Each node can take its input values and generate some output values. Those outputs can be used as inputs for other nodes. To minimize the amount of computation needed, node…
RenWal
  • 181
  • 2
  • 7