# Tagged Questions

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

424 views

### Converting a Sierpinski tetrahedron to a Graph

I need a representation of a 3D Sierpinski gasket in a form of a graph to perform some simulations on. The 2D version is included in GraphData[], but the 3D one is ...
2k views

### Trying to visualize the Collatz conjecture

I happen to have this collatz collatz[x_, y_] := If[x == 3*y || x == 2*y + 1 || y == 3*x || y == 2*x + 2, 2, 0] So i want a visual 3D adjacency graph of my ...
253 views

I want to thank you both for your help above. I'm going to abandon my quest for a number to label substitution using VertexRenderingFunction; because I need the ...
1k views

### Graph vs. GraphPlot

What is the difference (in purpose) between Graph and GraphPlot? Which function is bested suited to which tasks? Background: I ...
41 views

### Drawing a GraphPlot by preserving the structure of the graph

For eg. GraphPlot[{1 -> 2, 2 -> 1, 3 -> 1, 3 -> 2, 4 -> 1, 4 -> 2, 4 -> 4}, VertexLabeling -> True] Then If I remove the edge (say ...
25 views

### Does VertexAdd/EdgeAdd always simply append new vertices/edges to the old list?

I have a weighted digraph and I want to add new vertices and edges. The problem is that the EdgeWeight property value gets reset to automatic when a new edge is added. ...
38 views

### Min Weight Perfect Matching on General Graphs

I'm looking for a minimum weight perfect matching algorithm in Mathematica. Ideally, it should be able to handle arbitrary weighted graphs (e.g. not just bipartite, as that case is easy), although I ...
55 views

### How to make circuit-like diagrams [duplicate]

I was reading through a blog post and found some really nice graphs, and I was wondering how to generate similar ones with Mathematica:
262 views

### Graph diameter algorithm

Does anyone know what the complexity of Mathematica's GraphDiameter algorithm is? I have a family of very large (and very regular and very sparse) graphs, and if Mathematica uses something like the ...
70 views

### Can I make IsomorphicGraphQ consider other properties besides the EdgeRules?

Consider two graphs, which are isomorphic to each other based on the vertices and edges, ...
50 views

### Fastest way to import a large undirected graph from .ncol format

Problem: I have a large undirected graph in the .ncol format, and want to get it in to Mathematica. I understand that Mathematica doesn't natively support the ...
46 views

### Scale Vertex by Node Property

I would like to scale the nodes in a network according to various properties of those nodes. It's a fairly common thing to do with networks, but Mathematica's Graph...
25 views

### I am not able to label the vertex of the following graph in mathematica, can some one please help me.

Graph[{1, 2, 3, 4, 5, 6}, {1 -> 2, 1 -> 3, 2 -> 5, 2 -> 6, 5 -> 6}, VertexLabeling -> True] Graph::optx: Unknown option VertexLabeling in Graph[{1,2,3,4,5,6},{1->2,1->3,2->5,2->6,5->6},...
23 views

### Can mathematica's GraphDistance handle complex weights? Or unknown parameters eg. 'x'?

The EdgeWeight property states that the EdgeWeight can be any expression and the GraphDistance function states that in a weighted graph, it will return the minimum of the sum of the weights. So if I ...
49 views

### FindSpanningTree command doesn't work [closed]

I want to solve a network analysis problem by FindSpanningTree command. But it yields nothing: FindSpanningTree[G1] ...
211 views

### What does the GraphLayout -> “SpectralEmbedding” option do (mean) when displaying a graph?

I have some relational data represented as a graph. As such some of the relational properties can be recognized. When I use the GraphLayout -> "SpectralEmbedding" option a very nice and sharply ...
6 views

### Find least number of radial-subgraph of a graph [migrated]

Background: Here is a group G of a people, one maybe another's friend. How to select least number of people to be a leader of a subgroup, so that everyone in the group G has a friend as a leader? ...
142 views

### Deleting zero edges from a graph causes bizarre behavior

Bug introduced in 10.3.0 and fixed in 10.4. Consider the following (very simple) graph, with two vertices and one edge: g = Graph[{1, 2}, {1 <-> 2}]; I ...
159 views

### Finding all minimal paths in site percolation?

I want to find all minimal site percolation paths from the left side to the right side, small demo grid. A related question is here on finding bond percolation paths instead of minimal site ...
63 views

91 views

### How can I generate a graph from a NetworkX JSON

I have done some network generation and analysis in Python NetworkX. I do most of my visualizations with D3, but for publications I would like to generate some graph plots with Mathematica as well as ...
185 views

### How to get the Perfect Matching or Near-Perfect Matching

I have found the Perfect Matching's definition in Wiki. A perfect matching (a.k.a. 1-factor) is a matching which matches all vertices of the graph. That is, every vertex of the graph is incident ...
170 views

### Left Right Straight Maze

How do I generate a Left, Right and Straight ordering for a maze for something like the following? Similar to generating a left and right ordering for someone walking in real life. ...
55 views

### Which are the standard graph properties?

Graph objects can have different kinds of "properties": vertex properties edge properties graph properties Each of these can be standard ones, such as ...
104 views

### FindMaximumFlow generates a weird result

Bug introduced in 10.0 and persisting through 10.4.1 Try the following program: ...
203 views

### How to make a disconnected graph to be 1-edge-connected(but not 2-edge-connected) with some shortest edge

Assume I have a graph.You can run following code to get it. Import["http://goo.gl/NaH6rM"]["http://i.stack.imgur.com/EyAKW.png"] It is a disconnected graph.But ...
125 views

### How to connect some separate components with shortest total length line

Maybe this post too hard.So I try to make a simple version to research. Simulating a simple graph than that post. ...
57 views

### Network Analysis Problems with SystemModeler

Is it possible to analyse network problems like shortest path, minimum spanning tree, maximum flow, travelling salesman etc. with SystemModeler? If so where cm I find tutorials and examples?
35 views

### Where can I find documentation on the methods/algorithm used in FindGraphPartition in Mathematica 10?

I am working on a graph theoretical project where it would be helpful to know the name of the algorithm used in FindGraphPartition. Question: Where can I find ...
57 views

### Specifying number of clusters and members in CommunityGraphPlot

The Issue I am trying to specify the number of clusters and the number of members in each cluster that the CommunityGraphPlot function forms as part of a larger project. The Code This code ...
166 views

### Clickable graph

Can someone help me to make a clickable graph? Graph[{1 -> 3, 2 -> 3, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 2}] I found that ...
204 views

### How can I re-create the original Graph object from Graphics object into which that Graph was converted previously?

We can convert a Graph into Graphics very easily like it is shown in this answer. My question is: how to convert a ...
18 views

### Mathematica function for vehicle routing and CPM/PERT problems

Is there any built-in Mathematica function to solve general vehicle routing and CPM/PERT problems?
55 views

### “Graphics is not a Graphics primitive or directive.” when returning an Imported image for VertexShapeFunction

I am trying to use Graph (not GraphPlot) and replace some of the vertices with an image, like so: ...
125 views

### Tree graph showing all simple paths with dead ends between two vertices in undirected graph

I have undirected weighted labeled graph. How i can generate and visualize tree graph, showing me all simple paths (and dead ends) from vertice A to vertice B? For example, for this graph to show ...
61 views

### How to label some properties into graph like labeling EdgeWeight

We can label the EdgeWeight into edge like following ...
115 views

### Incompability between v5-6 and v10 with Graphs and Oriented Graphs pkgs?

Notice that "although the v6 Packages are available at the link in the answer above they are not fully compatible with v10". The errors 1, 2 and 3 in Mathematica 10 student edition may be due to ...