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)

2
votes
1answer
61 views

Changing edge weights in a graph using PropertyValue

I encountered a problem trying to change the EdgeWeights in a graph. I am runnning Mathematica 10.1 under Windows 7 Enterprise. I have an undirected graph with 144 nodes and 576 edges. I first ...
1
vote
0answers
39 views

Depth limited search in mathematica

I often use FindPath[G, 1, 2, {L}, All] where $G$ is some graph. This finds all paths of length exactly $L$ edges which run between nodes $1$ and $2$. In large ...
1
vote
0answers
78 views

Mathematica in Action (Wagon) — code to generate a great circle is giving error [closed]

I have code from Stan Wagon's Mathematica in Action, Chapter 17 (Great Circle Problem), but when I try to run it, it does not work. I have Mathematica 10. The code that does not run is shown below. Do ...
10
votes
3answers
247 views

Custom edge style (e.g. brush stroke, writing ink, etc.)

I would like to draw a graph with Mathematica in such a way that it looks like a handmade drawing or painting. To be more precise, is there a way to set a custom edge style such that it looks made ...
1
vote
0answers
47 views

How to set distance between connected vertices in graph?

I'm new at making graphs in mathematica 9, so I don't know if this question is contained in some of already asked ones. I started making it to visualize a polytope, which is build by a sertain ...
3
votes
0answers
57 views

How best to use or to emulate the “obsolete” Combinatorica command Contract?

The obsolete Combinatorica package has a command Contract for contracting an edge in a graph. Below is my very clunky attempt to work with up-to-date graph objects ...
3
votes
1answer
51 views

TreePlot: arrows on specific lines

I have the following list of rules: L={1->2,2->3,3->3}; and I want to plot a tree graph: ...
1
vote
1answer
29 views

WeaklyConnectedGraphQ evaluates to False. Is this the expected result?

Take the simple graph {1->2, 2->3, 3->1}: TreePlot[{1->2,2->3,3->1}] I would expect that ...
11
votes
2answers
246 views

Vertex descendants subgraph

Keywords: vertex, ancestors, descendants, subgraph, directed graph, flow subtree So let's say we have a TreeGraph: ...
1
vote
1answer
33 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 ...
4
votes
0answers
73 views
2
votes
2answers
138 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
213 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
162 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 ...
4
votes
2answers
188 views

Ploting a parallel graph for an animation

I am sorry that my attempt to obtain a fully functional plot as I want failed badly because I am not able to integrate the features to the graph. Here is my simple code: ...
8
votes
1answer
71 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 ...
0
votes
1answer
62 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 ...
4
votes
1answer
79 views

How to use the “EdgeLayout” suboption of GraphLayout?

According to the documentation, GraphLayout has an EdgeBundling suboption, which can take the following values: ...
1
vote
0answers
50 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 ...
8
votes
3answers
226 views

How to count all cliques (not just maximal ones) in graphs?

How can I count the numbers of $r$-cliques in a graph? In other words, the number of triangles, the number of $K_4$, the number of $K_5$ etc. I have tried for example ...
4
votes
1answer
141 views

Fast way to get edge-list of graph in terms of vertex indices (not vertex names)

I am looking for the fastest way to achieve the following: Given a Graph, retrieve its edge list in terms of vertex indices (not actual vertices). For example, ...
1
vote
1answer
61 views

LayeredGraphPlot how to change color of vertex box

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

How do I get all possible paths in terms of edges, and not vertices in Mathematica?

Suppose I have an undirected graph ...
0
votes
3answers
106 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 ...
2
votes
1answer
56 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
86 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}] ...
5
votes
0answers
128 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 ...
0
votes
3answers
94 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
136 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 ...
0
votes
1answer
166 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 ...
17
votes
1answer
463 views

Import and Plot Git Commit History

What might be the easiest to import and plot all commit history for a github project? I'm looking for something similar to the following.
8
votes
0answers
87 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 ...
1
vote
1answer
45 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
86 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
60 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
43 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
33 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
71 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 ...
5
votes
1answer
226 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. ...
0
votes
0answers
57 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: ...
0
votes
0answers
69 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 ...
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 ...
2
votes
1answer
97 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 ...
1
vote
0answers
100 views

GraphDistance gives incorrect result in weighted multigraph [closed]

Bug introduced in 10.0 and persisting through 10.3 Multigraph support was introduced in 10.0 There are bugs in Graph on Mathematica 10.1. For example, ...
5
votes
2answers
142 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
184 views

Vertex Order of Graph

Given a graph, I want to find the shortest distance between each pair of vertices: ...
5
votes
0answers
79 views

Issues adding properties to multigraph

Unsupported Functionality (loosely, a bug) Mathematica (as of 10.3) does not support multi-graph where edge properties vary between two nodes that share multiple edges. Although this is not ...
3
votes
2answers
85 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 ...