Questions tagged [digraphs]
A 'digraph' means 'one symbol written as two characters'. In printing it meant two letters cast as one piece of lead, e.g. ae, fi, ...
138
questions
0
votes
0
answers
15
views
`graph-tool` edge bundling circular layout graph from weighted adjacency block matrix
I am trying graph-tool by Tiago Peixoto to build a graph (either directed or undirected) from a given weighted adjacency matrix with a block structure. So far, unsuccessfully. My question partly ...
0
votes
1
answer
37
views
Is there an admissable heuristic for performing A* (A-star) search on a Directed Graph with cycles?
I am working on a school project which requires us to generate a random digraph with weighted edges and perform a number of graph traversal techniques to find one of the target nodes (marked in green) ...
0
votes
1
answer
33
views
Can someone tell me which language this is and how i should compile this into a graph?
Can someone tell me which language this is and how i should compile this into a graph? I downloaded a python code and after execute it gave me this back. There was nothing in the documentation except ...
0
votes
1
answer
35
views
igraph, Python - directed girth seems to not work
I'm working with randomly generated digraphs. I need to verify that the graphs I have have a girth of at least, say 3.
The solution I used is the following:
I generate a random adjacency matrix
I ...
-1
votes
1
answer
66
views
Trouble with digraphs: cannot borrow as mutable
I created a library to deal with digraphs: nodes that link (reference counted) to zero or one other nodes (as in linked lists, but in a digraph a node can be linked to by more than one node).
I am ...
0
votes
0
answers
59
views
List with references to its elements
I need to hold a list of nodes (strings) and have a "current" node (or more generally current nodes).
I would use a vector and current nodes specified by indexes, but sometimes a node is ...
0
votes
0
answers
121
views
Create a Postgres Schema from a JSON file
I have a pretty simple json file that represents a network (see below). I would like to create a postgres schema from the file so that would allow me to store the network structure in a postgres db. ...
0
votes
1
answer
66
views
how to add float typed weights to an retworkx digraph
In my pursuit after a fast graph library for python, I stumbled upon retworkx,
and I'm trying to achieve the same (desired) result I've achieved using networkx.
In my networkx code, I instantiate a ...
0
votes
1
answer
39
views
Is this total sink algorithm only for dags?
I found this algorithm for digraphs that checks whether a total sink exists in a graph.
https://www.geeksforgeeks.org/determine-whether-universal-sink-exists-directed-graph/
My question is : Is this ...
1
vote
1
answer
19
views
Manipulate existing labels on a digraph object
There's this graphviz digraph object generated from a library.
I'm trying to change the font for the labels...
digraph "something" {
graph [rankdir=LR]
node [margin=0 shape=plaintext]...
0
votes
0
answers
122
views
Finding In-degree of a node in a digraph
I am writing a program that prints out the in-degree of every node for each digraph for a set of digraphs given as adjacency lists.
This is the input:
4
1 3
2 3
0
3
1 2
1
0
The input is a sequence ...
0
votes
2
answers
157
views
Import graph from file to Networkx or NNGT
I need to build a large weighted digraph from data that's being exported from MatLab. The ultimate goal is to analyse it using NNGT, but it looks like building it using Networkx and then converting to ...
0
votes
1
answer
38
views
Forcing a node to stay on top when creating a cycle
I have the following graph:
digraph G {
u1, u2, u3, u5 [ shape = oval, style=filled, fillcolor="palegreen"];
u3 -> v3 -> v5_0 -> v5_1 -> v1;
u5 -> v8 -> v5_1;
v1 ...
0
votes
1
answer
233
views
How to determine the in-degree and out-degree of a node from a graph?
Whenever I apply H.neighbors(), to any node from my graph it shows none.
import networkx as nx
graph={'A': ['B', 'C'],
'B': ['C', 'D'],
'C': ['D','A'],
'D': ['C'],
'E': ['F'...
5
votes
1
answer
97
views
Single colons in arbitrary expressions?
I need to figure out what this obfuscated C++ code (written by someone else) does. I've figured pretty much everything, except one tricky part:
bool part1(char *flag)
{
int *t = (int *) memfrob(...
0
votes
0
answers
29
views
How to get different paths with same start and same end in a digraph(directed graph)?
giving a digraph like this:
1 --> 2
1 --> 3
2 --> 4
2 --> 5
3 --> 6
4 --> 7
5 --> 7
5 --> 8
7 --> 9
8 --> 9
6 --> 9
It`s easy to see there are 3 circle-like in graph.
...
0
votes
1
answer
29
views
Ideavim - how can I add digraphs
In Vim, i add digraphs by putting a line such as the following into my ~/.vimrc file to create a digraph for "ſ" (a long-s character):
:digr ls 383
However, adding such a line to my ~/....
1
vote
1
answer
359
views
networkx. digraph. walking from starting to ending nodes
Having networkx DiGraph presenting following structure:
I am trying to find a way to walk through the directed graph from far left nodes (without any incoming edges) presenting data sources from ...
0
votes
0
answers
105
views
Python DiGraph - Dynamic Source Data
This is probably a moon shot, but I'm looking to get started with my first Python project and I'm looking for advice.
The goal is to write some code that would be able to create the following graph. ...
1
vote
0
answers
49
views
What does angle braces initializer "a[] = <%1%>" means in C++? It gives out ouput as 1 [duplicate]
Why this is a valid thing?
int a[] = <%1%>;
cout<<a<:0:>;
0
votes
1
answer
23
views
How to make boxes appear where I want them?
I want the Openshift and letsencrypt to appear below the Stage and Prod segment. Now its aligned with the Prod and Stage segment. Is rank the way to solve it?
Also, is there a way to obtain results ...
2
votes
0
answers
98
views
Is there any module available in Erlang to find all the cycles of an undirected graph?
For a directed graph, we have the following module:
digraph_utils:cyclic_strong_components(G)
Is there anything like this available for undirected graphs in Erlang? I want to find all the cycles in an ...
1
vote
1
answer
575
views
Python Netgraph Interactive Labels
I am trying to create an interactive plot using netgraph and networkx.
I would like the plot to allow movement of the nodes and as the nodes move, the edges and edge_labels will also dynamically ...
1
vote
2
answers
123
views
Are digraphs transformed by a compiler and trigraphs transformed by a preprocessor?
I'm trying to understand both trigraphs and digraphs rather than use them.
I've read that post and I understood that:
Converting trigraphs to corresponding characters shall always be done by the ...
10
votes
3
answers
991
views
Breaking cycles in a digraph with the condition of preserving connectivity for certain nodes
I have a digraph consisting of a strongly connected component (blue) and a set of nodes (orange) that are the inputs to it. The challenge is to break as many cycles as possible with a minimum of ...
0
votes
1
answer
238
views
Simple Path and Simple Cycle in Graph DataStructure
I am unable to understand that does simple path in graph always contains first and last vertices as same?Can simple path be simple cycle ? Can simple cycle be simple path in graph data structure?...
0
votes
1
answer
211
views
Having a directed graph in pyhton (networkx), is it possible to create a subgraph according to a specific condition on the node attributes?
I have a twitter data set that i want to analyze,after creating a directed graph(the nodes are twitter users, and edge from a to b means a follows b)
how i created the graph :
I want to make a sub ...
0
votes
1
answer
208
views
Inconsistency in determining directed graph's back edges via DFS
I have found multiple algorithms that allows determining the back edges of a directed graph using DFS.
Unfortunately, I found an inconsistency in one of the graphs I am analyzing. Please find below a ...
0
votes
0
answers
99
views
Floyd-Warshall to Graph networkx
I created a graph using networkx (Python). I am trying to convert it to DiGraph but I can't get it right. I need to create (and work on) a Graph first, so I can't start using DiGraph() to build it at ...
0
votes
1
answer
545
views
how to set a top-down position in a graph networkx
This is my extended work from here.
I would like to set the last element 'm' in the unique_liss appears at the top position of the rest nodes like this.
However, most of the image generated would be ...
0
votes
1
answer
107
views
No digraphs available in vim
I can't get digraphs to work in vim.
When I type:
:digraphs
it gives me an error message: E196: No digraphs in this version.
Do I need to install any plugins or packages? If I type:
:scriptnames
...
0
votes
1
answer
307
views
Adjacency Matrix with Letters as Index
Hi I'm looking for a way to implement an adjaceny matrix, where I can use letters as the index... something like a hashmap?
I currently use a simple 2D array and I have converted the letters A-Z into ...
1
vote
1
answer
654
views
List of Successors of successors in a DiGraph in Networkx
I'm working on a function that creates a family tree using a directed graph in networkx, where the nodes are family members with the date of birth as a node attribute.
Now what i want to do is to make ...
0
votes
2
answers
476
views
Inserting unicode characters in vim
I would like a quick and easy way to insert certain unicode characters into text files with vim that I use often, for example, the British Pound Sterling and the tick characters instead of typing:
i ...
0
votes
1
answer
358
views
How to show k-partite graph in NetworkX?
I am currently looking for a solution to create a k-partite graph with Networkx. I have already implemented the bipartite graph and the image is attached
As one can see due to connection among nodes ...
1
vote
1
answer
166
views
Read digraph from a file
Hi all – I'm new to coding if anybody is wondering.
This is my first time posting here and I'm currently stuck on one of my assignments. The code below is my draft code.
The expected output for ...
0
votes
1
answer
2k
views
digraph object has no attribute 'add_path'
Scikit fuzzy rule formation cannot be done due to this error. Skfuzzy code and error message is shown below
import matplotlib.pyplot as pit
import skfuzzy as fuz
import numpy as np
from ...
0
votes
1
answer
226
views
Proof that you can turn a connected graph into a strongly connected digraph by turning every edge into an arch?
We consider the street network of a given city which is connected - from every junction we can
reach every other junction in the city (every street is a two-way street).
(a) The city hall wants to ...
1
vote
1
answer
101
views
Extract branches from digraph in MATLAB
I am looking for a way to extract the branches of a digraph in MATLAB. Precisely, if I have a network (my_digraph) similar to the following:
When I enter my_digraph.plot I recieve this:
I could now ...
2
votes
1
answer
1k
views
How to find the connected component containing max number of given set of nodes
I have a graph containing many genes and their interactions. I am interested in finding a subgraph with the maximum no .of a specific set of genes say, A, B, C, D, E in the graph.
Tried BFS ...
0
votes
0
answers
95
views
Converting List of words to Problem Graph For Minimum Spanning Tree Algorithm
I have been trying to construct a problem weighted Graph for Minimum Spanning Tree from a list or string of words as, given a string of words to list of named-tuple with every possible combinations of ...
5
votes
4
answers
2k
views
DiGraph parallel ordering
I have this kind of Directed Acyclic Graph with multiple roots:
And I need to get a list with nodes sorted by directions and grouped by steps, like this:
ordering = [
[1, 3],
[2],
[4],
...
1
vote
1
answer
2k
views
How to draw a DiGraph in a Org Chart fashion?
issue statement:
While I managed to get a chart out of a Networkx DiGraph via Matplotlib, I wish I could get better settings or be advised a more suitable library to draw it in a more 'readable' ...
0
votes
0
answers
292
views
Graphviz not displaying PNG in Python Idle
I am using the following code to display in image in Python IDLE but no luck.
import pydot
import graphviz
import os
G = pydot.Dot(graph_type = 'digraph')
node = pydot.Node('Name')
G.add_node(node)
...
0
votes
1
answer
236
views
write and read Graph, multiGraph, Digraph, MultiDigraph
Read and Write, Multigraph, MultiDiGraph ?
I'm working with networkx and osmnx, And I wanted to know if there is any way to write and read a Multigraph and MultiDigraph.
1
vote
0
answers
38
views
find patterns in digraphs
I'm trying to write simple code in java to find patterns (understood as recurrent sequence of elements in a superstructure) in digraphs (DAG) random generated.
I know for example the K-recurring ...
4
votes
2
answers
131
views
Label an edge with number of cycles it participates in
Given a graph G = (V, E), using DFS, how do I label each edge with the number of simple cycles it participates in? I am already labeling the nodes with a post-order when I extract the strongly ...
2
votes
1
answer
137
views
Find root of tree in Erlang / Elixir digraph
I have the following super simple digraph tree (code is Elixir):
digraph = :digraph.new()
coords = [{0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0}]
[v0, v1, v2] = (for c <- coords, do: :digraph.add_vertex(...
1
vote
1
answer
990
views
Python NetworkX - get DiGraph from nested dictionaries
I am trying to create a simple DiGraph in python's NetworkX from nested dictionary but it looks like built in initialization doesn't built final leaf nodes.
Toy example:
class_hierarchy= {-1: ["A&...
3
votes
1
answer
734
views
Construct networkx Graph from .p (picked) file
I have been doing Datacamp course called Intro to network analysis (Pt1) and there is a test network in a form of Graph/DiGraph.
In an interactive python shell on their website I can type T.edges(), ...