Questions about handling graphs in Mathematica, graph theory, graph visualization, GraphPlot, the built-in Graph type and the Combinatorica` package.

learn more… | top users | synonyms (2)

11
votes
1answer
119 views

IsomorphicGraphQ fails to recognize that two empty graphs are identical

Bug introduced in 9.0.1 or earlier and persisting through 10.3.0 Consider the following two graphs: ...
12
votes
2answers
396 views

Determining whether two $k$-chromatic graphs are isomorphic (respecting vertex coloration)

Consider the case where I have two $k$-chromatic graphs $G_1$ and $G_2$, i.e. two graphs where individual vertices can be colored with one of a set of $k$ total colors, and I would like to determine ...
9
votes
2answers
219 views
1
vote
1answer
32 views

Scan appears to work setting graph properties, but get error on property-read

This is a self-contained version of something a bit bigger - going for brevity. It is a bit synthetic, but there are applications I have in mind where the {{1,2}} will be replaced with real data, more ...
2
votes
1answer
49 views

Path with no dependence violations

I am guessing this will be a duplicate(it seems like a common task), but I obviously can't find the right page. I have a directed graph showing dependencies, and I want to list the vertices in an ...
2
votes
1answer
97 views

Finding nonequivalent 3-cycles and edges of a given graph

So I have three graphs defined by the following nested list, I'm using this list notation instead <-> notation because it is more convenient for another part ...
2
votes
2answers
108 views

How to find all possible paths with as many edges between two same vertices?

Suppose I have an undirected graph G = Graph[{1 <-> 2, 2 <-> 3, 2 <-> 3, 3 <-> 4}] I used ...
6
votes
2answers
198 views

Extract bibliography from a PDF document

I am trying to extract bibliographies from academic papers which are in pdf format, and I have to do this for 100+ papers. My goal is to create a network of citations amongst the authors and identify ...
6
votes
2answers
154 views

Grouping the list of numbers that have common.

I am working on some simple problem. It is like puzzle.. Let's say I have some list input={{1,1},{1,2},{1,3},{2,3},{3,3},{4,4}} Which means 1 can go and back to ...
5
votes
0answers
125 views

Number of 4-colorings of Johnson solids

I want to know the number of 4-colorings for all Johnson solids. This is equivalent to evaluating the flow polynomial for the corresponding polyhedral graphs at $k=4$. I tried the following to get ...
7
votes
1answer
62 views

Is there an easy way to set or retrieve a graph edge properties as a list, in a single go?

I am trying to use arbitrary edge properties in Graphs, and I am looking for easy ways to work with them. In many cases it would be convenient to be able to set ...
4
votes
1answer
71 views

How to use the “EdgeLayout” suboption of GraphLayout?

According to the documentation, GraphLayout has an EdgeBundling suboption, which can take the following values: ...
0
votes
1answer
52 views

Creating confidence interval plots for random graphs

I have the following code where I create instances of random graphs and use their properties to compute the mean of a quantity labeled 'PoA'. In the last line, I use a range of values for the ...
1
vote
0answers
45 views

Graph equivalent of GraphPlot's MultiEdge style?

I like the default display of Graph much better than that of GraphPlot, but I do not see how to turn off the use of multi-edges ...
0
votes
3answers
90 views

How to Change Vertex List in a Grid Graph

I would like to actually change the vertices in a grid graph instead of simply changing the label. Ultimately, I want the vertices to be points on a plane. So if given a simple grid graph ...
1
vote
1answer
52 views

LayeredGraphPlot how to change color of vertex box

For LayeredGraphPlot how to change the default yellow color? ...
2
votes
2answers
180 views

VertexLabelStyle not found in Mathematica 8.0.0.0

I tried to use VertexLabelStyle, but seemed not recognized in my system with version number 8.0.0.0. Is this expected or I have missed something? From the online ...
2
votes
1answer
55 views

How to draw vertices with identical names multiple times?

I have a list of rules that I would like to show as a layered graph. However, some vertex names appear more than once. How would one best deal with this situation? Example: ...
4
votes
1answer
79 views

Is there a way to efficiently generate a large “incomplete” k-partite graphs

A complete k-Partite graph can be divided into "k" distinct sets of nodes, each of which is connected to all nodes not in its own set. This can be generated with code CompleteGraph[{an, bn, cn}] ...
0
votes
3answers
85 views

Weighted and directed network computation in Mathematica

Is there any set of commands in Mathematica to compute mean shortest path, global clustering coefficient, diameter and radius of the network, etc. for weighted and/or directed graphs? There indeed ...
11
votes
1answer
135 views

How can I route edges manually for a Graph?

Most graph layouts supported by Mathematica use straight lines for edges; or at least something that only depends on the coordinates of the two adjacent vertices of the edge and nothing else. A ...
24
votes
3answers
2k views

Cycles of length N in a graph

If I have an undirected graph represented with an adjacency matrix, how can I find all the subgraphs which are a cycle of length N? I don't really know the math nor the programming language well, so ...
1
vote
2answers
122 views

How do I use Subgraph to sample the $n$ vertices of a graph with the greatest connectivity?

Let $G$ be an arbitrary graph with some number of vertices $||V||$ and some number of edges $||E||$. We can use Subgraph to generate, well, a subgraph of ...
0
votes
1answer
121 views

Network/Graph Visualization read edgelist

I have what it seems to be a very trivial question, but after searching for hours I was not able to find an answer, so I am asking here. I have an edgelist for a graph, a 2 column csv file with ...
8
votes
0answers
64 views

More efficient way to generate lattice graph with edges between visible vertices?

Given a nXn lattice, I need to generate the graph such that there is an edge between two vertices iff they are directly "visible" to each other, i.e., there is no vertex between them. I'm using ...
24
votes
4answers
578 views

How to get complete Documentation Center graph of guide pages?

On the very last image below you can see a typical path of walking through Documentation Center guide pages. What is the best way to get the graph data and visualize the whole structure of these ...
1
vote
1answer
43 views

Converting from GraphData to graph object

I know this is a simple question, but suppose I have a graph G = Part[GraphData[n],i] How do I convert this into a graph object accepted by ...
1
vote
1answer
75 views

Lack of arrows in Markov Chain graphs

I'm following this: http://www.wolfram.com/mathematica/new-in-9/markov-chains-and-queues/structural-properties-of-finite-markov-processes.html When I try to graph the Markov chain with Graph[proc] I ...
1
vote
2answers
53 views

How do I import a non-directed graph in graphml format?

I have created a graph with undirected edges, and I'm trying to import it into Mathematica. However, when I import it, I get directed edges. ...
2
votes
1answer
35 views

Increasing the font size in the Vertexlabels of GraphPlot

I have the following code and corresponding output: GraphPlot[Table[i -> Mod[3^i, 5], {i, 20}], VertexLabeling -> True] I wish to do two things: 1) ...
0
votes
1answer
32 views

Display options for GraphData output [duplicate]

How can the display of graphs using GraphData be customized? For example, how can we customize the vertex style, color, edge thickness of the output to...
9
votes
1answer
65 views

Cannot set VertexCoordinates twice in a Graph. Workaround?

Versions 10.0-10.2 seem to have a bug when trying to set VertexCoordinates twice on a graph (version 9.0 is fine). Can you confirm it? What is a good workaround ...
0
votes
0answers
57 views

ViewVector requires click before behaving with Graph3D (Also, viewing 3D subgraph “head on.”)

I want to produce 3D subgraphs that looks "head on" at the remaining vertices, held in their original positions via VertexCoordinates. The default viewpoint is not ...
5
votes
1answer
213 views

Adjacency matrix from image file of plane map

I have image files (PNG format) of plane maps of regions delimited by black borders I would like Mathematica to compute the associated adjacency matrix for the contiguous regions in these maps. ...
17
votes
4answers
319 views

What is the most convenient way to change options for Graph[] objects?

What is the most convenient way to change options such as VertexLabels in existing Graph objects? (Version 7 users note: ...
0
votes
0answers
55 views

adjacency matrix with directed graph connected nodes

I was trying to plot a 9x9 adjacency matrices which produce a useless directed graph. Codes for that I used: ...
9
votes
2answers
469 views

Sierpinski carpet with GraphData

Is this graph in the list among the so-called "standard" structures used in GraphData? However, I have not found, yet, anything like "Carpet" or "Sponge" in the ...
2
votes
0answers
37 views

Algorithm to determine if two colored graphs are isomorphic? [duplicate]

I have two (vertex-)colored graphs. I want to determine if they are isomorphic, with the condition that the isomorphism respects the colors of the vertices. Moreover, I want the algorithm to output ...
10
votes
2answers
427 views

Removing edge weights from a Graph

How can I remove EdgeWeights from a Graph without affecting any other properties of the graph? Let's construct a graph with ...
31
votes
4answers
6k views

Finding all shortest paths between two vertices

The built-in FindShortestPath and GraphDistance functions find the shortest path between two particular vertices in a graph. I ...
5
votes
0answers
126 views

Finding quasi-cliques

What is the best way to identify quasi-cliques in a graph in Mathematica? I don't think it has been implemented, so are there any solutions to do this? Or do I have to export the graph data somehow ...
11
votes
4answers
460 views

Efficient setting of properties of multiple vertices in Graph

The functions SetProperty and PropertyValue can only set a single property of a single vertex, as far as I know. How do I set a ...
2
votes
1answer
93 views

Multiple colors on a single graph edge?

Is there any way to put two colors on one single graph edge? For example, I want to highlight two cyclic paths (red and blue). But, if I put the two colorings into one image, it does not work as I ...
5
votes
2answers
130 views

How to show the direction of highlighted path in graph

I am trying to show the direction of FindHamiltonianPath on the Graph. ...
6
votes
1answer
151 views

Vertex Order of Graph

Given a graph, I want to find the shortest distance between each pair of vertices: ...
3
votes
2answers
77 views

How to specify different colors for edges going between the same two vertices in Graph?

Here is an example: edge1 = Property[1 -> 2, EdgeStyle -> Red]; edge2 = Property[1 -> 2, EdgeStyle -> Blue]; Graph[{edge1, edge2}] This does not ...
6
votes
1answer
213 views

Calculate dual graph of planar Graphics map

This diagram from a Wikipedia article illustrates what I hope to accomplish in Mathematica: I have a planar map in Graphics format. Here are two very simple ...