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, ...

In graph theory, 'digraph' is an abbreviation of 'directed graph'. You may want to use the more explicit tag directed-graph.

In computer programming, digraphs and trigraphs are sequences of two and three characters respectively, appearing in source code, which a programming language specification requires an implementation of that language to treat as if they were one other character.

Various reasons exist for using digraphs and trigraphs: keyboards may not have keys to cover the entire character set of the language, input of special characters may be difficult, text editors may reserve some characters for special use and so on. Trigraphs might also be used for some EBCDIC code pages that lack characters such as { and }.

155 questions
2
votes
0 answers

new C++ standard syntax? -> const std::vector a<% 1,2,3 %>;

I stumbled upon this code without any explanation. Googling it is a nightmare, please explain what's this: const std::vector a<% 1,2,3 %>;
Soup Endless
  • 439
  • 3
  • 10
2
votes
0 answers

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 undirected graph. Is there a method by which I…
2
votes
1 answer

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 another function that given the graph G and a…
Tacoman
  • 21
  • 2
2
votes
2 answers

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 C-v u00A3 = £ i C-v u2713 = ✓
Tony Barganski
  • 1,873
  • 20
  • 17
2
votes
1 answer

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 algorithm and also connected components. But do not know…
yathrakaaran
  • 179
  • 1
  • 3
  • 15
2
votes
1 answer

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(digraph, c)) :digraph.add_edge(digraph, v0,…
Thomas Browne
  • 23,824
  • 32
  • 78
  • 121
2
votes
1 answer

Finding a cycle or loop after digraph_utils:is_acyclic/1 returns false

How can I (efficiently) find a cycle or a loop in an Erlang digraph after digraph_utils:is_acyclic/1 returns false? EDIT: is_acyclic is defined as loop_vertices(G) =:= [] andalso topsort(G) =/= false.
Filip Haglund
  • 13,919
  • 13
  • 64
  • 113
2
votes
2 answers

Digraph and trigraph can't work together?

I'm learning digraph and trigraph, and here is the code which I cannot understand. (Yes, I admit that it's extremely ugly.) This code can compile: #define _(s) s%:%:s main(_(_)) <% __; %>t This code can compile, too: #define _(s)…
nalzok
  • 14,965
  • 21
  • 72
  • 139
2
votes
1 answer

DirectedGraph: addVertex(Vertex v), String cannot be converted to Vertex

I am trying to learn and implement Directed Graph and facing some difficulties in executing the program. // ADD Function public boolean addVertex(Vertex v) { boolean added = false; if (verticies.contains(v) == false) { added =…
user3337714
  • 663
  • 1
  • 7
  • 25
2
votes
1 answer

Interface for BinaryRelation

I’d like to define elegant interfaces for a binary relation and for a transitive relation. I consider a binary relation as a set of pairs, a subset of some set X × Y. In fact I intend to work mainly with transitive relations, but I occasionally need…
Olivier Cailloux
  • 977
  • 9
  • 24
2
votes
1 answer

Using dictionary of dictionaries in django templates not working well

Weighted Directed Graphs are represented as dictionaries of dictionaries in python. Something like this (example): digraph = {'a': {'b':2, 'c':3}, 'b': { 'a':1, 'd',2}} My problem involves passing this digraph object to the Django Template…
Pranjal Mittal
  • 10,772
  • 18
  • 74
  • 99
2
votes
1 answer

Disabling digraphs in vim

I have an unusual problem with my gVim installation - approximately half the time that I turn on my computer, gVim automatically replaces character sequences such as 'a and "o with their corresponding digraph characters. The other half of the time,…
tgbrooks
  • 241
  • 1
  • 10
1
vote
1 answer

Graph edge overlay when visualizing a networkx DAG using multipartite_layout

Consider the following snippet defining a DAG and drawing it: import matplotlib.pyplot as plt import networkx as nx g = nx.DiGraph() g.add_edge(1,2) g.add_edge(2,3) g.add_edge(3,4) g.add_edge(1,4) for layer, nodes in…
1
vote
3 answers

Use networkx to calculate the longest path to a given node

I have a networkx digraph. I would like to compute the longest path to a given node (from any possible node where there exists a directed path between the two). There are functions like nx.dag_longest_path_length but those do not directly support…
user344577
  • 127
  • 6
1
vote
1 answer

Can you specify a bidirectional edge in a NetworkX digraph?

I'd like to be able to draw a NetworkX graph connecting characters from the movie "Love, Actually" (because it's that time of the year in this country), and specifying how each character "relates" to the other in the story. Certain relationships…
Lou
  • 2,200
  • 2
  • 33
  • 66
1 2
3
10 11