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

How to style (give color) Link from group to generic node?

In my CGA assignment, I have to create the state transition animation. the rule is look like this, All attack animation have to grouped in a group. Each animation state could be attacked If the current state get attacked, link to attacked state /…
user3583513
0
votes
0 answers

Shortest path in a directed graph with incorporating global path weight

Consider a directed edge-weighted graph G = (V,E), with edge-weights in modeling the local relationship between two nodes. I want to find a shortest path in that graph with additional global constraints on the paths, for example formulated in a…
madison54
  • 743
  • 2
  • 8
  • 19
0
votes
1 answer

Add separate element in JointJS DirectedGraph

Is it possible to add elements outside of the DirectedGraph's function? I have tried using graph.addCell() as in the documentation, but the chart only shows elements from the DirectedGraph plugin. I'm trying to accomplish a DirectedGraph where…
Glen Despaux Jr
  • 1,064
  • 7
  • 19
0
votes
1 answer

Algorithm that returns sets of vertices that are equal distance (not infinite) by a Vertex

Write an algorithm that, given a graph G and a vertex t of G, returns sets of vertices that are equal distance (not infinite) by t. The graph G is the following: Considering t = A, the algorithm should return: Set of vertices at distance 0:…
user3808470
0
votes
0 answers

Fastest way to import nodes/edges into a NetworkX DiGraph from CSV?

I'm trying to improve the speed of my NetworkX DiGraph population from CSV. Right now I've got a straight forward csv reader and graph add situation: G = DiGraph() nodes = csv.DictReader(open(nodeFile, 'rU'), ['index', 'label', 'type']) for row in…
dubmojo
  • 6,660
  • 8
  • 41
  • 68
0
votes
2 answers

How to plot a directed graph with the designated start point in R

Here is the data I use to test,which is in graph.txt: 1 2 1 3 2 5 3 4 3 5 4 5 5 6 5 10 6 7 7 8 7 9 7 12 8 9 9 10 9 4 9 12 10 11 11 2 11 12 I use the graph.data.frame to plot the directed graph. the code is: xlist<-read.table("graph.txt") xlist <-…
Cheng
  • 193
  • 3
  • 10
0
votes
1 answer

Finding cycles in a directed graph implemented using an unordered multimap

So, I've implemented a directed graph using an unordered multimap. Each pair within the map is made up of two strings: the vertex and its adjacent vertex. Now, I am trying to determine if my graph has a cycle, and if so, how big is the cycle. This…
busebd12
  • 997
  • 2
  • 12
  • 24
0
votes
1 answer

get adjacency matrix of a directed graph in python-igraph

My question might sound stupid but how can I get the adjacency matrix of a directed graph? Let me explain. I have the following code: g = Graph() g.add_vertices(5) g.add_edges([(0,1),(1,2)]) print(g) print(g.get_adjacency()) The first print…
ahajib
  • 12,838
  • 29
  • 79
  • 120
0
votes
2 answers

Wrong recursive function to find number of possible routes

I'm using a nested dictionary to indicate a graph's vertices and edges, like: [ A: [B,D,E], B: [C], C: [D,E], D: [C,E], E: [B] ] This is my code so far: def number_of_trips(self, start_point, end_point, maxstops): return…
juliano.net
  • 7,982
  • 13
  • 70
  • 164
0
votes
1 answer

Directed Graph vertices and edges reversed

So I'm working on this problem: Here's what I have so far a) Create a new graph with the same size 2-dimensional array, B. Iterate through the original graph's 2-dimensional array, A, which is of size VxV, where V is the number of vertices in the…
Jake Senior
  • 223
  • 4
  • 11
0
votes
1 answer

d3 directed graph with varying stroke-widths

I'm trying to make a simple directed graph using d3. I have the basic graph up and running referring to the examples http://bl.ocks.org/mbostock/1153292 , http://bl.ocks.org/d3noob/5155181 and http://bl.ocks.org/dustinlarimer/5888271 The issue I'm…
arjun010
  • 129
  • 1
  • 2
  • 12
0
votes
1 answer

How can I visually compare refactoring options?

I have an existing system model, representing services calling APIs backed by one or more implementations in perhaps other services, in the form of a DAG. I've been rendering this by GraphViz dot files' digraph which is fairly reasonable, if…
0
votes
1 answer

How to create directed graph with nodes having multiple data?

I want to create a graph with nodes and edges, where each node will contain n number of values. We would be given with the n values of the starting node, from which we need to generate other nodes where each value in each node would be of the form…
0
votes
0 answers

Drawing lines between nodes in directed graph. UML Classes?

I am not sure if I am on the right lines of thought here so I am really just looking for someone to tell me how wrong I am. Basically I am looking to create a class drawing tool, pretty much like any UML software. I am looking for 90 degree line…
Questioning
  • 1,903
  • 1
  • 29
  • 50
0
votes
1 answer

Adding text labels to force directed graph links in d3.js

I am having trouble adding a text to the links that connect the nodes in the following D3JS connected node graph: http://jsfiddle.net/rqa0nvv2/1/ Could anyone please explain to me what is the process to add them? var link = svg.selectAll(".link") …
Oliver Hoffman
  • 540
  • 1
  • 9
  • 22