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)

4
votes
2answers
34 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
22 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
33 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 ...
4
votes
2answers
251 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
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
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? ...
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...
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:
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
52 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 ...
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 ...
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
10
votes
0answers
201 views
+200

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 ...
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
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 ...
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 ...
5
votes
1answer
88 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 ...
3
votes
1answer
54 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 ...
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. ...
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: ...
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 ...
1
vote
2answers
192 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 ...
9
votes
1answer
164 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 ...
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
53 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: ...
2
votes
0answers
61 views

How to label some properties into graph like labeling EdgeWeight

We can label the EdgeWeight into edge like following ...
2
votes
1answer
56 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?
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: ...
0
votes
1answer
50 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 ...
5
votes
4answers
163 views

How can I reduce a directed graph to only its “junctions”?

I'd like to take a directed graph, e.g. ...
3
votes
1answer
54 views

Plotting the complement of a graph without changing the name of the vertices

I have a graph in the form {Dog -> Apple, Apple -> Screwdriver}, I used to plot a graph in the following way: ...
1
vote
2answers
53 views

Plotting points using adjacency matrix

Given an adjacency matrix on n vertices and a polygon on n vertices, how to add edges from adjacency matrix on the Polygon? eg: if polygon is {(0,0),(0,1),(1,0),(1,1)} and the adjacency matrix has 1 ...
2
votes
0answers
48 views

How to understand the LocalClusteringCoefficient use in directed graph? [duplicate]

When this function use in undirected graphs,its action is normally and can be explained by this formula $$CC_v=\frac{n}{C_{k}^{2}}=\frac{2n}{k(k-1)}$$ n is adjacent nodes of $v$'s number of ...
3
votes
2answers
135 views

Visibility Graph of Polygon

Could anyone provide a function that takes a polygon as input and outputs its visibility graph ? Visibility Graph If not, is there a function that checks whether a line segment lies inside a polygon?
3
votes
0answers
80 views

A unexpected behaviour of RelationGraph

$Version "10.4.1 for Microsoft Windows (64-bit) (April 11, 2016)" I want to match the based point of VoronoiMesh(...
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},...
0
votes
2answers
31 views

Finding vertices with a given degree; or, finding indices

I have a graph g and would like to find all the vertices in g with degree n. ...
1
vote
1answer
68 views

Permutations on graph vertex labels

I want to generate all the possible adjacency matrices of equivalent unlabeled graphs. For example, consider the simple path graph of three vertices. There are three possible adjacency matrices: <...
8
votes
3answers
119 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 ...
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] ...
0
votes
0answers
25 views

The command SocialMediaData still returns a blank plot [duplicate]

I have Mathematica 10.3.1 in Mac OS, and the command SocialMetaData is not working, returning a blank plot. I have seen a similar question from Nov 28 '15, but it is still not solved. ...
4
votes
1answer
54 views

Generate graphs from the output of GraphAutomorphismGroup

Given g = Graph[{1 -> 2, 2 -> 3, 3 -> 1, 4 -> 1, 1 -> 5, 5 -> 4}, VertexLabels -> "Name"] GraphAutomorphismGroup[g] outputs ...
0
votes
1answer
32 views

Incidence matrix not reproducing the graph

I am trying to reproduce the graph from an incidence matrix. For eg i have ...
9
votes
2answers
160 views

HighlightGraph Problem

Bug introduced in 9.0 or earlier and persisting through 10.4.1 HighlightGraph does not work. ...
5
votes
1answer
85 views

Is it possible to use a function for EdgeWeight in a Graph?

Why I cannot calculate all edge weights beforehand: I have many large graphs for which I'd like to find the shortest path between two vertices (FindShortestPath ...