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
0
votes
2 answers

python networkx- save disconnected graphs from single figure into separate files

I have following program that generates my graph and displays it on a single figure. Edges2 = [(1, 2), (1, 3), (1, 4), (4, 5), (6, 7), (6,8)] G = nx.DiGraph() The function that generates the graph is as follows: def…
marcincuber
  • 3,451
  • 1
  • 17
  • 29
0
votes
2 answers

Printing the smiley-with-beard lambda expression

I tried printing the smiley-with-beard lambda expression #include int main() { std::cout << <:]{%>; // smile! return 0; } but it printed 1 instead. How?
abcoep
  • 577
  • 9
  • 14
0
votes
1 answer

Create a random graph or its corresponding adjacency matrix from a given degree list

I have the following problem in R: I have a vector that contains the degrees of 200 nodes in my graph. Strictly speaking should they present out-degrees. Is it possible to create from these existing degrees for the nodes i = 1, ...,200 a random…
Fulla
  • 17
  • 6
0
votes
2 answers

Retrieve the "out degree" of every vertex of a digraph (jgrapht)

I have a digraph created using: public static DirectedGraph directedGraph = new DefaultDirectedGraph(DefaultEdge.class); public static Point firstPoint = new Point(2, 7); Vertices and edges were created with…
Graham Slick
  • 6,692
  • 9
  • 51
  • 87
0
votes
1 answer

Preprocessing C99 digraphs away

Is there a way to "preprocess" C99-style digraphs to obtain a C file (or a .i preprocessed source) such that the resulting file does not contain any digraphs? For instance, given the following source code: %:define N 5 int main() <% int a<:N:> =…
anol
  • 8,264
  • 3
  • 34
  • 78
0
votes
1 answer

Error when changing method parameter to an object (jgrapht library)

I'm trying to modify the Jgrapht's functions to take as parameters a point's couple of coordinates (int, int). I create a class and a Point object defined by (x,y) and put it as the directedGraph's parameter public class Point { public…
Graham Slick
  • 6,692
  • 9
  • 51
  • 87
0
votes
1 answer

Define vertices and edges based on a matrix' elements and jgrapht library

I have a matrix representing a grid, made with 0s,1s and 2s. There is a 0 when there isn't any element on the grid, a 1 when there is an element that can be moved, and a 2 when it's an element that can't be moved. For example: 0 0 0 0 2 2 0 0 0 0…
Graham Slick
  • 6,692
  • 9
  • 51
  • 87
0
votes
1 answer

Finding roots in multiply rooted graphs

We deal with a directed graph which may contain or not cycles and may be or not be connected. We want to find the minimum set of vertex such that every other vertex in the graph is accessible from them. For example,…
Jsevillamol
  • 2,425
  • 2
  • 23
  • 46
0
votes
1 answer

Unhlandled exception due to bad pointer usage

it's my first question here so I apologize for eventual formal mistakes you may found in my post. I'm coding a simple class for "Undirected Connected Weighted Graphs", which must use Adjacency Lists based on vectors. The issue is that when I run the…
mitxael
  • 52
  • 7
0
votes
0 answers

Marking Nodes on a Digraph

I have a digraph problem where I need to mark each node and print the nodes as marked and unmarked with regarding the edges in the given input and accept or reject if they are both marked in their respective start and end state in java. I have…
Sweaver
  • 63
  • 7
0
votes
1 answer

increasing i in a loop in python

Can I somehow create a loop that runs through some code I have and for every time it runs through the loop a increases, and print out the line in the bottom? a=0 str1 = h[a] dG = nx.DiGraph() for i, word in enumerate(str1): try: …
0
votes
2 answers

how can I work with digraphs and trigrpahs in bloodshed/DevC++ compiler

In compiler trigraphs and digraphs are not replacing by the corresponding single characters. Rather it's giving a warning something like this, 12:26 G:\BIN\cLang\macro2.cpp [Warning] trigraph ??= ignored, use -trigraphs to enable I want to know…
amin__
  • 1,018
  • 3
  • 15
  • 22
-1
votes
0 answers

How to add a node in D3Blocks or D3graphs?

I cant seem to find a function to add just one node to D3graphs in python. There is a way to add adjacency matrix but not node by node like in pyviz. But I need to add just one node. Something like the following: for index, row in df.iterrows(): …
Joe
  • 39
  • 3
-1
votes
1 answer

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 trying to use my library to create a list with a…
porton
  • 5,214
  • 11
  • 47
  • 95
-1
votes
2 answers

Which algorithm do I need for this directed graph operation?

I may be overthinking this and be missing something obvious, but I was wondering which NetworkX algorithm I could use to achieve the following: Given a DiGraph such as: And a list of nodes such as: Q1, Q2 Find all nodes which are connected to (or…
1 2 3
10
11