Questions about handling graphs in Mathematica, graph theory, graph visualization, GraphPlot, the built-in Graph type and the Combinatorica` package.
3
votes
2answers
90 views
TreePlot EdgeLabeling Style
I am trying to control the style for edge labels in treeplot and have run into a problem.
Consider these two graphs:
...
5
votes
1answer
298 views
Ordering vertices with minimum Edge Crossing in Circular Graphs
Weighted and sorted Mathematica circular graphs are shown below. My question is how to reorder the vertices in such a way that they have minimum cuts (intersection of edges) while keeping the circular ...
2
votes
1answer
196 views
Speed up iterated manipulations of a graph / table
I am trying to generate a version of Watts' model of cascading shocks to a network following the discussion on p. 20-25 of this article.
The basic premise is to use the ...
14
votes
2answers
379 views
How can I speed up the classic GA for graph coloring?
I'm trying to compute the chromatic number of this graph (which is 28):
g = Import@"http://www.info.univ-angers.fr/pub/porumbel/graphs/dsjc250.5.col";
My genetic ...
0
votes
1answer
82 views
Problem setting up edge rendering function
I have a graph, and I want my EdgeRenderingFunction to colour the edges based on the vertex they originate from. In this toy example, I'm trying to get the edge ...
6
votes
2answers
186 views
Can I put tooltips in a Graph?
This doesn't work:
Is there a way to do this? My real goal is to identify the second links in the graph below, which shows the results of a webcrawl (using this code). I'm open to another ...
1
vote
1answer
116 views
EdgeRenderingFunction and Graph input output structure
I am trying to create an EdgeRenderingFunction but the more information does not help me at all as far as explaining what the ...
2
votes
1answer
170 views
Changing some stuff to Kruskal's Algorithm
I'm trying to modify this algorithm:
http://demonstrations.wolfram.com/ConnectingTownsUsingKruskalsAlgorithm/
The thing is that I want to receive a Graph (declared outside, with all its vertex, edges ...
7
votes
1answer
409 views
How to speed up Minimum Spanning Tree algorithm?
How to speed up MST algorithm? I work with graphs and I have adopted Prim's algorithm for my needs, from here.
The graphs which I use are very dense (number of vertexes: $V=500$ and every vertex is ...
3
votes
0answers
204 views
Finding a Graph Shortest Path with Custom Graph Distance Function
What is the best way to find a shortest path by using a custom distance function? I'm trying to play a little bit with the concept of using distributions instead of a deterministic weight value for ...
2
votes
1answer
141 views
Isomorphisms for graphs with loops and multiple edges
I am working with graphs with multiple edges and loops, and I want to eliminate all isomorphic graphs from a long list I've generated. The FindGraphIsomorphism ...
4
votes
1answer
278 views
(Efficiently) Generating graphs with vertex degree 3 for all vertices
I'm working on a graph theory problem, and given $n$ vertices, I would like to be able to generate all non-isomorphic connected graphs (not necessarily simple) with $n$ vertices, each having degree 3. ...
5
votes
4answers
444 views
How to generate random directed connected graph?
How to generate random directed connected graph?
I need to create graph which will pass:
ConnectedGraphQ[^]
6
votes
1answer
172 views
Interactive Graph Editing with Animation
I want to make a simple interactive user interface like this:
Such that when the user clicks on the "Add Edge" button, the edge specified by from and to fiels is added to the graph. The new graph ...
4
votes
1answer
322 views
Creating a weighted, directed graph from ordered triples
I have a relatively large set of data that I am trying to turn into a weighted, directed graph. The data concerns the inflow of migrants based on country of origin. I currently have three columns of ...
8
votes
2answers
216 views
Transition between graphs
I want to visually demonstrate the manipulations made to a graph. For instance, I have a graph g where using the command ...
2
votes
2answers
147 views
Showing a forest with root of the trees on the top
I have a Graph object that contains a forest with directed trees. I want to draw the forest such that the root of the trees are on the top and the leaves are on the bottom. If I use the following line ...
5
votes
2answers
798 views
Eigenvalue / Eigenvector Calculation
I'm currently trying to compute the three smallest eigenvectors for a 34 by 34 matrix. While I was expecting this to take some time, Mathematica has been running for the past 3 hours, which seems ...
7
votes
1answer
219 views
How to implement hive plot for graphs in Mathematica?
I'm trying to implement a version of the hive plot advocated in [Kryzywinski, et al., 2012]. There are many examples of such graphs on the author's webpage.
It would be good enough for me to have ...
17
votes
2answers
1k views
How to play with Facebook data inside Mathematica?
I saw this post from Wolfram here and I would like to know how to import facebook data into Mathematica.
16
votes
3answers
675 views
How to generate a random tree?
Is it possible to generate a random tree without explicitly constructing a random adjacency matrix that satisfies tree properties? How about a random directed tree?
Edit: incredible answer by ...
25
votes
5answers
2k views
Custom arrow shaft
Inspired by Sjoerd C. de Vries' nice answer to this question, and the desire to pimp a Graph I did with Mathematica recently I would like to know if there are ways to customize the arrow's shaft ...
10
votes
1answer
181 views
Transform an expression into a graph that can be plotted with TreeGraph (not TreeForm)
I would like to plot an expression (like TreeForm does), but using the new TreeGraph functionality.
...
4
votes
2answers
133 views
How to make each node of a graph a button?
A newbie question this one - MMA help seems to suggest it would be possible to place a button on ( or have a button be ) each node of graph, labelled with the name of said node. I have no idea where ...
3
votes
1answer
284 views
Control over depth-first scan and breadth-first scan
Is there a way to conditionally take control/modify the flow during a depth-first scan or the breadth-first scan ?
Say, for example, if a particular node if found, consider it as a leaf-node and ...
4
votes
3answers
172 views
5
votes
2answers
234 views
Merging (combining) tables of graph relationships (2-mode to 1-mode network)
I have some data of corporate board members in Australia in excel format here (Dropbox public link). It is the data behind this graph. The first worksheet is of all the vertexes (directors and ...
11
votes
1answer
129 views
Layout a second graph of the same nodes in the same way
I have a number of graphs with the same nodes.
I would like to be able to somehow save the layout that results from the spring embedded results of one graph (the first image), and have the other ...
11
votes
2answers
375 views
Calculating morphometric properties
Is it possible to calculate segment length, segment diameter and branch angles for three dimensional geometry. Geometry contains vertex points and polygon surfaces as
...
13
votes
2answers
326 views
How to measure segment length and branch angle
I am trying to measure segment length and branch angle or bifurcation angle between each pair of segments.
My image after thinning looks like this:
...
11
votes
1answer
352 views
Use Mathematica to do a network analysis of Mathematica.SE
Recently Wolfram|Alpha announced that you could use it to analyze your Facebook site. How could I do a network analysis of questioners and answers here on Mathematica.SE?
10
votes
4answers
323 views
Ordering vertices in GraphPlot
I'm new here, so forgive me if this question is not well-posed/duplicates an earlier question - although I've searched for similar questions without success.
I'm trying to present a plot of ...
3
votes
1answer
186 views
3
votes
1answer
138 views
Labeled and Graph don't mix?
In an attempt to create a legend for a graph drawing, I find that Labeled only works without the position options (except for Center).
...
13
votes
1answer
259 views
Visiting nodes in a tree bottom up
I have a problem that can be reduced to this one:
Suppose I have an unbalanced (almost random) tree. The leaves of the tree have one property already set, and all vertex (including the leaves) have ...
10
votes
0answers
270 views
Drawing dessins d'enfants (bipartite graphs subject to certain conditions)
I want to write a function which constructs all possible dessins d'enfants (bipartite graphs fulfilling certain criteria, given below) from a collection of data presented in the following form:
...
1
vote
1answer
117 views
Community structure algorithm [closed]
I'm using CommunityStructureAssginment[] from GraphUtilities but not sure what is the algorithm behind it.
May be someone knows what is the algorithm? Or any info on the community structure ...
6
votes
1answer
240 views
How to turn a random graph into a matrix
I have constructed a random graph with Mathematica using the RandomGraph command. Now I would like to convert this graph to a matrix, but I don't know how. The ...
7
votes
3answers
201 views
How can I efficiently check if a graph is unit distance?
A unit distance graph is a graph that is embeddable in the plane so that every edge has length 1.
...
3
votes
2answers
174 views
Combinatorica: Girth[] and FindCycle[] disagreement
Warning: run the following code in a fresh Mma session, as some symbols could be shadowed (depending on your Mma version)
While trying to answer this question, I fell into the following:
...
4
votes
2answers
122 views
Odd behavior of GridGraph and DirectedEdges
For some reason the option DirectedEdges->True, albeit working internally with grid graph, does not appear in the visualisation for 1D and 2D graphs. It also ...
3
votes
1answer
99 views
Using EdgeList on a once empty Graph crashes the kernel
Calling EdgeList on a non-empty graph which was previously empty causes the math kernel to crash.
For example,
...
6
votes
3answers
505 views
Find cycles of graphs with both directed and undirected edges
I need to enumerate all the simple cycles of a graph which has both directed and undirected edges, where we can treat the undirected edges as doubly directed. (Specifically, I am looking at the Cayley ...
4
votes
1answer
143 views
Enhancing GraphUtilities' GraphEdit
One thing I use Mathematica for is building molecular graphs.
Until now, I've been content with generating an adjacency matrix from SMILES data, and passing that to ...
10
votes
2answers
232 views
Proper way to add vertices to an adjacency matrix
I'm looking for a robust way to add vertices to a graph by modifying its AdjacencyMatrix.
Here's what I have so far:
...
5
votes
3answers
138 views
StandardForm on Graph edges
The Graph command displays edge labels in TraditionalForm. I instead want to use ...
11
votes
2answers
698 views
How to convert an image to a graph and get the positions of the edges?
I am trying to convert an image to a graph. My image is already skeletonized and looks pretty much like this:
What I need to do is identify all vertices and edges, and in particular get a list of ...
6
votes
4answers
237 views
Can I stop edges in graphs from drawing on top of the vertices?
Consider the following
testadj = RandomVariate[BernoulliDistribution[0.15], {50, 50}];
AdjacencyGraph[testadj, VertexSize -> Large]
The nodes are almost ...
13
votes
3answers
514 views
Creating diagrams for category theory
Lately I've been doing algebra and I have found myself drawing a bunch of diagrams when I attempt to solve a problem. Most of the diagrams are very simple so I thought, I bet I can do this in ...
16
votes
3answers
324 views
How to get complete Documentation Center graph of guide pages?
On the very last image below you can see a typical path of walking through Documentation Center guide pages. What is the best way to get the graph data and visualize the whole structure of these ...


