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)

13
votes
3answers
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 ...
30
votes
2answers
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 ...
3
votes
2answers
253 views

Building a Career Ladder Lattice (Follow up)

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 ...
25
votes
1answer
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 ...
4
votes
2answers
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 ...
0
votes
0answers
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. ...
1
vote
0answers
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 ...
2
votes
0answers
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:
5
votes
2answers
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 ...
4
votes
1answer
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, ...
1
vote
1answer
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 ...
1
vote
1answer
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...
1
vote
1answer
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},...
1
vote
1answer
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 ...
0
votes
0answers
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] ...
10
votes
0answers
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 ...
0
votes
0answers
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? ...
9
votes
1answer
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 ...
6
votes
2answers
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 ...
3
votes
0answers
63 views

Finding all Minimal Cut Sets for Site Percolation?

I want to disconnect the left side from the right side. The minimal cut set $C$ is a set of vertices by which the lattice $\mathbb L-C$ becomes disconnected. Consider the example below $\mathbb L=\...
2
votes
1answer
53 views

How can you delete a list of vertices from a GridGraph?

Given a grid graph: and delete the vertices {3, 4, 5, 11, 14, 15, 16, 17, 18, 19, 21, 23, 26, 27, 30} and preserve the structure. There is the ...
3
votes
2answers
148 views

Deleting vertices from a Graph and preserving structure

My goal is to remove vertices from graphs (and the edges from them) and then take GraphComplement to find out cut sets in graphs with sink and source such as here. ...
1
vote
2answers
112 views

Using Combinatorica`ListNecklaces in v9

I am using Mathematica for visualization of DeBruijn graphs. However, I am having a bit of trouble using ListNecklaces. I want to know how many cyclic shifts of ...
6
votes
3answers
327 views

The same value of VertexSize for vertices in different graphs causes different vertices size

I generated some graphs. The smallest vertices in the 1st graph should be the same size as the smallest vertices in the second graph. The smallest vertices have the same size (...
1
vote
0answers
39 views

How do I find and enumerate the number of perfect matchings in directed complete graphs?

I would like to enumerate All the 1-factors or perfect matchings, of the complete directed graph Kn (the number of vertexes is even ) if there is an algorithm or method to enumerate all the perfect ...
2
votes
1answer
47 views

MinimumVertexColoring does not work

g=RandomGraph[{5,6}] MinimumVertexColoring[g] I am using MacOS and Wolfram Mathematica 10.4
3
votes
1answer
268 views

The unexpected behavior of FindMinimumCostFlow?

Bugs(the fourth and fifth behavior) is present in V10.4.1 I'm at a loss to understand the behavior of the FindMinimumCostFlow function. Here are a few cases I ...
1
vote
1answer
41 views

converting a named graph into a graph object

I am seeking the edge lists of the complements of named graphs on n vertices. At first sight I would use ...
3
votes
3answers
235 views

How to compute the automorphisms of graphs with multiple edges?

I try to compute the Automorphisms of graphs with multiple edges from its AdjacencyMatrix but failed. The following code shows ...
0
votes
0answers
20 views

How to fix <<MathWorld`Graphs` package cannot be opened? [duplicate]

From http://mathworld.wolfram.com/PaleyGraph.html I downloaded this notebook http://mathworld.wolfram.com/notebooks/GraphTheory/PaleyGraph.nb. The notebook contains the line ...
10
votes
1answer
378 views

Is there a function to generate a minimal clique cover?

This is a graph problem known as the "Clique Edge Cover" or "Intersection Number" problem, and the goal is to find, from a given graph like $E=\{\{a,b\},\{a,c\},\{b,c\},\{b,d\},\{c,d\}\}$ and $V=\...
5
votes
1answer
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 ...
4
votes
2answers
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 ...
11
votes
1answer
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. ...
3
votes
1answer
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 ...
5
votes
0answers
104 views

FindMaximumFlow generates a weird result

Bug introduced in 10.0 and persisting through 10.4.1 Try the following program: ...
3
votes
2answers
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 ...
1
vote
1answer
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. ...
2
votes
1answer
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?
1
vote
0answers
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 ...
0
votes
1answer
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 ...
9
votes
1answer
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 ...
1
vote
2answers
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 ...
0
votes
0answers
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?
0
votes
1answer
55 views

“Graphics is not a Graphics primitive or directive.” when returning an `Import`ed image for `VertexShapeFunction`

I am trying to use Graph (not GraphPlot) and replace some of the vertices with an image, like so: ...
8
votes
3answers
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 ...
2
votes
0answers
61 views
2
votes
0answers
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 ...
11
votes
2answers
131 views

Why are some of the isomorphisms not bijective?

Bug introduced in 10.4 Mathematica computes all the isomorphisms between graph g1 and g2: ...