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)

21
votes
2answers
2k views

How to plot planar graphs as such?

A planar graph is a graph that can be drawn in the plane such that no two edges cross. For example, the graph ...
6
votes
1answer
339 views

How to determine edgeweights from width of skeleton using MorphologicalGraph (or workaround)?

Background I'm trying to create a workaround for what seems to be a bug in MMA's graph functions related to edge weights: SO: How to Label Graph Edges with their weights According to MMA's ...
7
votes
1answer
943 views

Mathematica: Label specific vertices in GraphPlot

How can I label particular vertices in GraphPlot? And have the arrows space out accordingly, for the width of the label? I have Mathematica 7, but I think this question applies to all versions. ...
9
votes
4answers
480 views

Show path with arrows in a matrix

I have a matrix, for example, 5x5 matrix Partition[Range[25], 5]. And I am given a list, for example: ...
15
votes
6answers
449 views

How can I remove B -> A from a list if A -> B is in the list?

I have a list of transformations like this: list = {"A" -> "B", "B" -> "A", "C" -> "D"} As this is used to plot an undirected graph with ...
14
votes
3answers
3k views

How to generate random directed acyclic graphs?

How to programmatically build random directed acyclic graphs (DAG)? I know about the AcyclicGraphQ predicate and the ...
22
votes
1answer
761 views

Visualizing Rubik's Graph

After the August 2010 discovery that the diameter of the Rubik graph is 20, I wanted to make a way to visualize Rubik's graph. Since there are about $4.3 \times 10^{19}$ vertices in this graph, it is ...
8
votes
1answer
171 views

Using GraphHighlight interactively

I want to build a small GUI, where the user can select either a single edge or a single node of a graph. I got to this point: ...
9
votes
2answers
268 views

VertexSize doesn't scale with Graph layout?

I wonder about how I could make a Graph scale automatically when I vary the size of the vertices. I would like to visualize information with a ...
5
votes
1answer
252 views

Implementing local complements of graphs

I'm trying to write a routine which generates the local complement of a graph at a vertex. For those who don't know, the local complement for a singly-connected, undirected graph is defined as the ...
15
votes
1answer
848 views

How to export and import Graphs with additional data?

I'm trying to export and then later import graphs with additional data added such as VertexLabels and EdgeLabels. When I export ...
21
votes
1answer
981 views

How to create regular (planar) graphs?

How to programmatically create and plot regular planar graphs with $k = 3, 4$ or $6$ (not hypercubes) and regular nonplanar graphs of $k = 8$ (see figure)? Note that what matters is the average ...
15
votes
3answers
250 views

What is the most convenient way to change options for Graph[] objects?

What is the most convenient way to change options such as VertexLabels in existing Graph objects? (Version 7 users note: ...
60
votes
3answers
2k views

Automatically generating a dependency graph of an arbitrary Mathematica function?

Has anyone written a function to pull the function dependencies of a function? That is, it would be nice to have a function that returns a list of function dependencies as a set of rules, terminating ...
5
votes
1answer
246 views

How do I find a weighted bipartite graph's minimum edge cover using Mathematica 8?

In graph theory, we use the Hungarian Algorithm to compute a weighted bipartite graph's minimum edge cover (a set of edges that is incident to every vertices, the one with the minimum total weight.) ...