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)

3
votes
0answers
31 views

WeightedAdjacencyMatrix does not complete for Connected Graph

Please see code snippet below - I have a weighted, connected graph that models a software process using a DiscreteMarkovProcess. I set some of the edge weights to ...
1
vote
0answers
59 views

How-to make large graph more readable?

One day, I found myself curious about different topics in mathematics. So, I stumbled uppon a website (considerably old website) where author has tabularized mathematics into subjects and associated ...
4
votes
4answers
120 views

GridGraph with diagonal edges

I have n x n GridGraph (or n x m), I trying to add diagonal edges for each square box automatically and then assign same weights to the diagonals, same weights to horizontal edges and same weights to ...
2
votes
1answer
69 views

Some strange graph from “RelationshipGraph”

I want use this code to graph the all of function in image-processing. ...
3
votes
3answers
83 views

Reverse the layout when using “DiscreteSpiralEmbedding”

I have a graph such as NestGraph[# + 1 &, 1, 10, GraphLayout -> "DiscreteSpiralEmbedding", VertexShapeFunction -> "Name", VertexSize -> .2] But ...
4
votes
1answer
27 views

How to get the VertexWeight list or EdgeCapacity list in a graph

The graph of Mathematica.We have VertexList or EdgeList.So we can get it convenient like ...
6
votes
1answer
94 views

Is a bug about the FindFundamentalCycles?

My graph is ...
3
votes
1answer
69 views

How to make the graph to specific layout

For the artistic,the graph layout could be more important sometimes.So I must to put a bad sentence to describe the clumsy GraphLayout of ...
4
votes
1answer
75 views

Odd behaviors of FindKPlex

Bug introduced in 9.0 and persisting through 10.4 FindKPlex is new in 9.0. I have a example about it. ...
0
votes
2answers
80 views

How to make a graph form imported spreadsheet data [closed]

I've three csv files: v.csv for vertex data, like this: 1 2 3 ... e.csv for edges: 1,2 2,4 2,24 3,1 ... and vcoor.csv for vertex coordinates: 23.4, 35.2 23.4, 40.3 ... I know how to construct a ...
0
votes
1answer
63 views

How can I code a graph visibility criterion using an If-statement?

The visibility criterion can be defined as follows: two arbitrary data values $(ta , ya)$ and $(tb , yb)$ are visible to each other if any other data $(tc, yc)$ placed between them fulfills the ...
2
votes
1answer
40 views

Certainty of the New Vertex Name after using EdgeContract

It appears that when I use EdgeContract on an undirected graph, the vertex that is the result of contracting an edge is always named the smaller of the two ...
3
votes
1answer
18 views

Why does Mathematica report the VertexEccentricity of a disconnected vertex as zero?

"For a disconnected graph, all vertices are defined to have infinite eccentricity" So, why does Mathematica report the VertexEccentricity of a disconnected vertex as 0 instead of ...
1
vote
1answer
23 views

VertexContract, VertexReplace and non-anonymous collapsed node

Can the standard VertexContract or VertexReplace functions display a name for the collapsed node ? Here is a minimal example: ...
2
votes
1answer
54 views

Trying to remove duplicate isomorphic graphs in a list of graphs [duplicate]

I am working on a Mathematica program that involves taking a graph and generating all of its single-edge contractions. When I get this list of contractions, it often happens that many of the graphs ...
3
votes
1answer
65 views

How can I get the arguments of the function Graph?

If I have f0 = f[x,y,z] and I am interested in the list of the arguments, what I do is ...
8
votes
1answer
144 views

Petrie polygon projection of a hypercube graph

I am trying to generate the Petrie polygon projection of the 8-cube in Mathematica, like this one: I tried using, for example, the HypercubeGraph function: ...
0
votes
0answers
14 views

Acyclic Directed Graph, NeighborhoodGraph and ancestors [duplicate]

What is the correct way of find the list of a given vertex' ancestors in an ADG ? I am thinking that a pattern in NeighborhoodGraph might be the solution or a negative option for the degree of ...
3
votes
1answer
64 views

Find independent vertex sets

I'm trying to find all independent vertex sets for a given graph. Note that they may not be maximal independent sets. There is a function in Mathematica called ...
8
votes
2answers
238 views

Plot a 3-cycle graph with clockwise-directed edges

When I try to plot a 3-cycle, the edge direction is always counter-clockwise. The plotting code is ...
6
votes
2answers
112 views

Small World network on a square grid

My aim is to generate a 2D Small World network on a square grid. i.e. 20x20. With a probability of 5%, one node rewires from an adjacent node to a random node of the grid, allowing some long distance ...
2
votes
0answers
113 views

How to make a flowchart? [closed]

I'd like to make a flow chart in similar to this: I think it's more of a layout and stylistic question for a graph - how to style a graph with labeled edges and vertices so that it looks like a ...
1
vote
1answer
45 views

Trying to get simple excel data to be imported as a social network directed graph

My data has two columns that we'll call A and B. The columns proceed as such A B A1 B1 A2 B2 A3 B3 .... I'm trying to make this into a directed graph where A1 has an outgoing edge to B1 and ...
1
vote
1answer
63 views

Deleting vertices from 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. So How can I delete vertices from a ...
3
votes
3answers
94 views

Random bipartite graphs?

RandomGraph[{n,m}] generates a random graph with $n$ vertices and $m$ edges. I want to generate a random bipartite graph, like ...
2
votes
2answers
101 views

VertexDelete Problem

I am doing a straightforward deletion of a set of vertices in a Tree using Mathematica. ...
4
votes
2answers
119 views

How can I make this code to count Hamiltonian paths faster?

I have this very basic code to count Hamiltonian paths in a graph: ...
10
votes
1answer
89 views

Arrows from GraphicsComplex not converted to Normal form correctly

Bug introduced in 7.0 or earlier and persisting through 10.4.0 Show @ Graph[{1 -> 2, 2 -> 3}, Frame -> True] Normal @ % Is this a pure bug, or have ...
5
votes
0answers
51 views

What's meaning of `VertexConnectivity`?

Are there a conflict in this two place in documentation? In the Basic Examples: Then the Properties & Relations But actually:
0
votes
0answers
66 views

Plotting a graph on a torus and another surfaces [duplicate]

I'm trying to figure out how to plot a graph on a surface. My goal is to represent a planar embedding of $ K_5$ in a torus. I have encountered this post, where you can find an explanation how to plot ...
2
votes
1answer
66 views

VertexLabels with Graph Properties

Suppose I have a graph like this Graph[ {1 <-> 2, 2 <-> 3, Labeled[3 <-> 1, "hello"]}, VertexLabels -> Placed["Name",StatusArea] ] Now ...
2
votes
1answer
61 views

Generate list of traceable and planar graphs

Is there any way to tell Mathematica to generate a list of graphs that are both traceable and planar?
14
votes
2answers
293 views

Zoom in on a 2D graph

I have seen many queries on zooming in on plots etc. But I haven't seen any regarding 2D graphs. For eg if I have a graph like Graph[{1->2, 2->3, 3->1}]. ...
3
votes
1answer
145 views

Hasse Diagrams from Adjacency Matrix

Let's say I have a rather large adjacency matrix for a partial order relation. Say an 80x80 matrix. What is the best way to display Hasse diagram? I have tried AdjacencyGraph and it does a not so bad ...
14
votes
1answer
312 views

GeoGraphics : path within a country

I am using GeoGraphics to visualize electricity distribution networks in certain countries. I have susbtation location data, as well as network incidence matrices ...
8
votes
0answers
111 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}]; ...
19
votes
2answers
377 views

Reconstruct a graph from an image (curved edges and edge crossings)

Actually, I posted a very similar question before this.How to generate a Graph from a picture of a graph Dr. belisarius's answer have answered that question, but I find a limitation in that method: ...
1
vote
0answers
53 views

Is there a way to update a graph in place?

I'm assembling graphs programmatically, and looping through EdgeAdd[] a lot. graph = EdgeAdd[graph, a -> b]; Is there a more efficient way to do the updates ...
12
votes
1answer
259 views

How to generate a Graph from a picture of a graph?

I have a picture like this I can get this graph's vertexes ...
5
votes
2answers
124 views

How to use Mathematica to calculate number of spanning tree?

As the title,The graph g is: ...
1
vote
1answer
51 views

How to set color for some graph's vertex? [closed]

I defined graph and got this visualization ...
1
vote
1answer
73 views

Combinatorica and DualPartition function (for a Young diagram)

I am trying to understand how to evaluate the arm and leg functions of a Young tableaux using Mathematica. To do so I need the Combinatorica package. Then apparently the command ...
0
votes
0answers
83 views

How to graph the all of the possible isomorphic graph?

We can get one form of it use Graph ...
6
votes
2answers
63 views

How to specify custom graph styles for `GraphStyle`?

There is a way to specify custom themes for plots (Is it possible to define a new PlotTheme?), but themes to not apply to Graph objects, not even to ...
1
vote
3answers
58 views

How to draw graph with named vertices by adjacency matrix?

I have the adjacency matrix of graph and I want visualize this graph. I tried: ...
5
votes
1answer
120 views

What exactly does LocalClusteringCoefficient compute for directed graphs?

For undirected graphs, the LocalClusteringCoefficient of vertex v is ...
1
vote
1answer
99 views

Visualizing Matrix that represents a network

I have a nxn matrix $A$ that represents a network. I have $n$ nodes in the network, and the matrix $A$ represents the number of connection (edges) between the different nodes. For example, if $A$=0, ...
10
votes
1answer
400 views

Shortest tour with vertex priority

I changed the title of my question and tried to simplify formulation of the problem. I solve a very big vehicle routing problem. I divided this one big problem on many small sub-problems. Each small ...
6
votes
1answer
114 views

Networkgraph, Thickness of edges based on calculated values

On this blogsite I've read a interesting blog about visualising a correlation matrix. So I started with a simple file like: ...
4
votes
1answer
281 views

Graphs in 3 dimensions

I have a desired graph as here: the dashed line is just for perspective representation. I tried with LayeredGraphPlot and ...