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
0answers
114 views

How to draw hypercube graphs

I'd like to draw hypercube projections like those on the Wikipedia page: I tried with HypercubeGraph[6] but the graph does not look right; it is not ...
6
votes
3answers
302 views

Export Graph to PDF

I know that I exported Graphs to PDFs before but it doesn't seem to work any more. I tried K5 = GraphData[{"Complete", 5}] Export["K5.PDF", K5] And I get a PDF ...
2
votes
1answer
129 views

How to get a list of 3-connected graphs?

I'd like to use GraphData to get a list of graphs with vertex connectivity at least 3. I know GraphData["Nonplanar", 6] gives ...
5
votes
1answer
220 views

How to view all graphs available in GraphData?

Is there a "gallery" view of all the graphs available in GraphData? I realize that some graphs may not lend themselves to such representation (e.g. some may have ...
5
votes
1answer
151 views

Why do vertex labels disappear when I edit with drawing tools?

I'm trying to change the text and arrow style in GraphPlot using the drawing tool, but the the vertex labels disappear when I do that: ...
10
votes
2answers
478 views

Dynamic graphics are less responsive inside a Manipulate

I have some code which displays a GraphPlot and allows the user to click on any vertex in the graph to display some information about that vertex in a popup window. ...
3
votes
1answer
182 views

Bring Vertices to the foreground

I'm having some issues with being able to trigger the Tooltip in an AdjacencyGraph, as the edges are "covering" the vertex labels. In the example provided, there are no issues to display the tooltip ...
7
votes
3answers
508 views

Visualizing the output of a Voronoi diagram computation

I need to plot a graph (to be specific: Fortune Algorithm output) with given vertex coordinates and a few unconnected vertices. I am thinking of using Mathematica for that. ...
1
vote
1answer
138 views
3
votes
2answers
126 views

LineGraph Labels

I have a graph with labels on the edges: ...
1
vote
2answers
157 views
2
votes
1answer
72 views

Arranging “ranked” nodes of a graph symmetrically

I have Markov chains with a pair of absorbing states taken from the $n$-length strings formed from {"H","T"} for n at least 3 ...
1
vote
2answers
169 views

Plotting bipartite graph from adjacency matrix

I have an $m\times n$ matrix $A$ representing the adjacencies between the nodes of a bipartite graph. Specifically, the nodes are arranged in two partitions, of $m$ and $n$ nodes respectively, such ...
3
votes
3answers
122 views

EdgeRenderingFunction on a Graph plot

This is my code, I want each line leaving a vertex to be the same colour from that vertex. So there should be 5 different coloured lines one colour for each vertex. ...
2
votes
1answer
103 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
1answer
53 views

How should my data be formatted for use with BetweennessCentrality?

A few weeks ago I asked this question. I am trying to upload my data which is an adjacency list for an undirected, unweighed graph and find the betweenness centrality. At the time I tried to use the ...
0
votes
1answer
113 views

How do I upload a graph as an adjacency list and find the betweenness centrality?

I have an undirected simple graph in a .txt file formatted as an adjacency list like this: 100 200 200 300 300 400 500 600 700 800 900 ... Every number is a node ...
4
votes
1answer
177 views

How do I make the color of arrowheads in a graph different from the colors of the arrows?

I'm graphing a Markov process mp = DiscreteMarkovProcess[{1, 0, 0}, ({ {0.6, 0.1, 0.3}, {0.2, 0.7, 0.1}, {0.3, 0.3, 0.4} })]; and would like ...
1
vote
1answer
60 views

What does the VertexMoving method for FindGraphCommunities do?

I've been applying the VertexMoving method to some graph data, and it's producing very useful results. However, I've got no clue as to what this method actually is, and the documentation is ...
1
vote
1answer
108 views

How do I show the transition probabilities in a graph of a Markov process?

How do I get Graph to display the transition probabilities for a Markov process as labels on the graph's edges? The information is clearly present in the graph, but ...
0
votes
1answer
131 views

Get histogram of number of vertices per component of graph H

I have a huge graph with ~8k vertices and ~1k components. I want a histogram showing the number of vertices for each component. How do I do this? EDIT: I'm trying ubpdqn's approach, but not gettting ...
0
votes
2answers
329 views

How to find number of connected components of graph G?

Is there a command that can count the number of components of a graph, in the same way that VertexCount[G] counts vertices?
1
vote
1answer
64 views

Importing adjacency matrix from file of 0/1 arrays

Is it possible to import adjacency matrix for graph representation, from simple text file with NxN (rows x columns) of 0s/1s: 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 0
3
votes
1answer
176 views

Writing results directly to file

I am trying to find all simple paths in a large directed graph (542 vertex, density ~ 5%) between two nodes. For this purpose, I use the algorithm from this thread. Unfortunately, my computer is ...
4
votes
2answers
121 views

TreePlot, VertexRenderingFunction and stretched vertices issue

Recently I found the following TreePlot issue. For simplicity, I took an example from Mathematica Tree Drawing Tutorial and set ...
1
vote
1answer
95 views

References on functions FindGraphPartition and FindGraphCommunties

Does somebody have some interesting references on the FindGraphPartition and FindGraphCommunties[.., Method -> "Spectral"] ...
7
votes
3answers
216 views

Different colors for nodes in tree plot

I have some list of numbers which I am plotting using TreePlot. This is the code: ...
3
votes
2answers
210 views

Horizontal Tree Layout? [duplicate]

I need to display arbitrary Expressions in TreeForm, but the standard vertical layout produces too many horizontally overlapping boxes. Am I doomed to rewriting ...
18
votes
2answers
770 views

Graph layout on a grid

Is it possible for Mathematica to layout a graph so that the connections lie on a grid? Furthermore, for graphs with multiple edges per vertex, is it possible to specify the location on the vertex ...
1
vote
2answers
102 views

How to sort the adjecency matrix of bipartite graph so to have two off-diagonal blocks

In a bipartite graphs there are two class of nodes, say A and B. Each node of class A may interact only with nodes of the class B, and viceversa. The corresponding adjecency matrix is thus composed by ...
3
votes
1answer
368 views

Combinatorica Graph from Edge List

Can someone provide an example of a Combinatorica-based graph which uses ShowGraph and Graph and takes in an explicitly defined list of edges (not some auto-generated graph). I have not been able to ...
1
vote
1answer
57 views

How do I visualize the result of EdgeColoring[g]?

Combinatorica has a heuristic edge-coloring function EdgeColoring. When I execute it on a graph, the result is a list of integers. My guess is that an integer $i$ ...
1
vote
0answers
55 views

Why does Network`GraphPlot`wrapper appear in my GraphPlot?

I'm making a GraphPlot of data similar to this: ...
6
votes
0answers
82 views

HighlightGraph and Hyperlink

In the documentation of Mathematica it is mentioned that you can use Hyperlink and Tooltip as wrapper in a similar manner as ...
1
vote
1answer
73 views

How do I use Subgraph to sample the $n$ vertices of a graph with the greatest connectivity?

Let $G$ be an arbitrary graph with some number of vertices $||V||$ and some number of edges $||E||$. We can use Subgraph to generate, well, a subgraph of ...
0
votes
1answer
80 views

How to efficiently distinguish the rewired edges in WattsStrogatzGraphDistribution?

The WattsStrogatzGraphDistribution function is a way to construct random graphs based on Watts and Strogatz small world model. The ...
2
votes
1answer
119 views

Plotting Network with LayeredGraphPlot with specific order

I have a network and want to plot it. I use LayeredGraphPlot, and the network is described as: ...
7
votes
2answers
103 views

How can I recover a graph from a graphical output in a notebook after resetting the kernel?

I have an old Mathematica notebook with an output for a graph structure $G$ I would like to recover. However, the routine for building up the graph is stochastic, so I can't simply rerun the code. ...
2
votes
0answers
53 views

Can BreadthFirstScan be modified?

I would like to obtain a "slick" implementation of A*-search algorithm on Graph objects, using the built-in BreadthFirstScan (if that is possible at all). I noticed that BreadthFirstScan is static in ...
2
votes
1answer
54 views

Reversibly abstracting a list of strings as a graph object where vertices represent strings and edge connect pairs of strings based on various tests

Imagine I provide you a list of arbitrary strings, say: Map[StringJoin, Tuples[{"0", "1", "2"}, 4]]. I'd like to abstract these strings as a graph object in ...
1
vote
1answer
34 views

Check Specific Connections within Graph

Say you have the skeleton of a graph: fullSkele = PolyhedronData["GreatRhombicosidodecahedron", "SkeletonRules"] and you've an arbitrary list of some fraction of ...
2
votes
2answers
118 views

How to make a recursive code from this iterative code? (drawing tree graph)

I have a question about drawing tree graph. I use my iterative code to build a tree graph. Here it is. ...
0
votes
0answers
46 views

Get correlation matrix when using FindGraphCommunities

Does somebody know how to get the correlation matrix when using FindGraphCommunities (Social Network analysis) using the "Spectra" option? Can somebody tell me as ...
1
vote
1answer
75 views

Social Network Analysis - Get the List of InBoundEdges for Directed Graph

I wish to get the list of inwards edges for a node. IncidenceList provides both inwards and outwards list. I can of course filter with ...
5
votes
3answers
386 views

Fast code to generate large random graph with fixed degree sequence

I'm trying to create a function so to generate large random graph with a fixed degree sequence $\{v_1,v_2,\dots,v_N\}$, where $N$ is the number of vertices in the graph. The Mathematica function that ...
3
votes
1answer
155 views

Social Network Analysis - Get the End Points of an Edge

I want to get the end points of an Edge of a Graph. For example see the following source, ...
0
votes
1answer
86 views
4
votes
1answer
135 views

Katz Centrality [closed]

I want to calculate the Katz Centrality of large graphs. The Mathematica command to do that is KatzCentrality[g, $\alpha$] and it is also fast. However I realized that there is a mismatch between ...
1
vote
1answer
182 views

Display a labeled multigraph

Despite the integration of graphs and networks, multigraphs are not supported in Mathematica 8+. In Mathematica 9+, GraphPlot misbehaves for multigraphs having ...
6
votes
1answer
195 views

Generating a (random) 2-dimensional cellular network

I want to generate a network of random cells like the following picture: The general idea is to generate some random points (x,y) as coordinate of a vertex and then randomly choose some of these ...