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)

1
vote
1answer
38 views

Having trouble using different options with GraphPlot [closed]

I am extremely new to Mathematica and I am trying to plot some graphs. GraphPlot[{1->2, 2->3, 3->1}] works just fine. But as soon as I try to use ...
8
votes
3answers
439 views

Mathematica 10 Graph issue

fixed in 10.0.2 Please try to evaluate this code in Mathematica 10. ...
3
votes
1answer
144 views

Interpreting a formula from Graph Theory - where do x and y come from?

I'm trying to understand the generating function for OEIS A062734, which is in Mathematica. Essentially, despite knowing no Mathematica at all, I think I can parse most of it, but where do $x$ and $y$ ...
2
votes
1answer
41 views

VertexConnectivity and FindVertexCut disagree [duplicate]

I'm trying to use Mathematica to compute the minimal vertex cut for graphs. From what I understood, VertexConnectivity of a graph should correspond to the number of vertices in the minimal vertex cut. ...
5
votes
2answers
244 views

Is there something wrong with VertexConnectivity

Note: this is fixed in version 10. As I noticed in the documentation VertexConnectivity is defined as the following The vertex connectivity of a graph $g$ is ...
2
votes
1answer
96 views

Vertex Names as Labels in GraphPlots

I'm trying to use GraphPlot to draw a Graph which is constructed from an adjacency matrix and am having trouble with the labels in the plot. I am doing (data is a silly example) the following: ...
5
votes
0answers
173 views

Citation of the algorithms used in FindGraphCommunities

For my research work I need to put a comparison of different community detection algorithms. Instead of implementing all those algorithms once again, I would like to use the methods already provided ...
1
vote
2answers
73 views

Split graph into independent maximal cliques?

Does Mathematica have a method to partition the vertices of a graph into maximal independent subsets, such that each subset generates a complete subgraph? Edit: The partition should be maximal in the ...
3
votes
0answers
56 views

FindGraphCommunities method options?

FindGraphCommunitites has a couple of method options: "Modularity", "Hierarchical", ...
1
vote
3answers
81 views

How to control which nodes get placed at each radius with GraphLayout → “RadialEmbedding”?

I have a directed graph each of whose nodes belongs to exactly one of three groups: "sources", "sinks", and "both". As these names suggest, nodes in the "sources" group have only outgoing edges; ...
1
vote
0answers
77 views

Is there a minor bug in Neal Alexander's TopologicalSortAll[]?

There is an amazing answer to this question: All possible topological orderings of a graph By Neal Alexander. However, as user "dark blue" (I am not this user) notes: ...
1
vote
1answer
59 views

Twisting a graph layout (by fixing the $x$ coordinate of all its vertices)

I would like to draw a given graph $G$ in a specific way and I would like to know whether Mathematica can do it in a (semi-)automated way. My goal is to draw the graph $G$ in 2D, fixing all the $x$ ...
0
votes
1answer
63 views

How to use Hold on a variable defined as a graph

I'm working on doing operations on different graphs and getting their probability node degree distributions using a simple algorithm. If I have many defined graphs, for example: ...
5
votes
2answers
144 views

Test existence of a path from one side of a graph to another

I'm trying to determine how I can test if a path exists from one side of a graph to another as efficiently as possible. If I have the Lines given by: ...
0
votes
1answer
109 views

TreeForm vs TreeGraph

Is it possible using TreePlot to color part of the nodes in the tree in a different color, and to make a path to the node with different color? I used ...
4
votes
1answer
81 views

Minimal Colouring of Graph Vertices

Is there a way to colour graph vertices minimally in new Mathematica? I tried loading MinimalVertexColoring with the old Combinatorica package but it doesn't work ...
3
votes
1answer
117 views
3
votes
1answer
85 views

FindShortestPath with VertexWeight

I have a weighted graph on which I want to perform some FindShortestPath calculations. However, the problem is that my weights are defined for vertices with ...
6
votes
0answers
40 views

What system functions use VertexWeights?

EdgeWeights -> are used by a lot of functions, but I can't find any exposed usage for VertexWeights ->. I'm not asking ...
0
votes
0answers
63 views

What graph distributions are available in Mathematica?

Where can I find a list of all the graph distributions available in Mathematica?
25
votes
4answers
3k 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 ...
3
votes
1answer
287 views

Map of all graphs obtainable with GraphData?

I've been trying to put together an answer to another question, but I am stuck, so I decided to post this question instead. Mathematica contains (among its curated data) information on definition, ...
1
vote
1answer
161 views

Can degenerating Nicomachus' triangle down to $0$ area by using `Graph` be done?

I noticed a pattern in Nicomachus' Triangle that might be used to reduce the triangle to the number line. If the Edge size could be set to the absolute difference ...
5
votes
2answers
128 views

Visualizing subgraphs while specifying the locations of vertexes

I would like to visualize separate connected components of a graph defined by data points lying in the two-dimensional plane by surrounding each connected component subgraph by a bounding curve. I ...
4
votes
1answer
63 views

Edge Labels with distance between vertices

I am trying to make traveling salesman type graph using the locations of NFL stadiums as the vertices. I need to get the EdgeLabels to appear was the distance between the vertices. I was able to ...
3
votes
1answer
90 views

System of differential equations on a directed graph

I want to use Mathematica to model blood flow through a capillary network. The approach we are using is going to be to create a directed graph, and have a system of differential equations at each ...
1
vote
2answers
79 views

How do you apply an algorithm individually to an array with many graphs

I have and array with many graphs to which I want to apply an algorithm (below) to each graph in an array that contains all my graphs. ...
2
votes
1answer
101 views

Community detection on weighted graphs?

The documentation says that FindGraphCommunities works with weighted graphs. I've been playing around with a complete graph with weighted edges, and FindGraphCommunities always returns a single ...
2
votes
0answers
60 views
0
votes
0answers
47 views

Transform NMinimze into LinearProgramming formulation

I have the following maximization problem that I currently try to solve with Minimize/NMinimize. Unfortunately, this kind of solution method takes really long for large systems of equations and ...
3
votes
1answer
140 views

Visually Separating Cliques in Graphs

I have a graph with 189 vertices, more than 10,000 edges and 20 cliques. As one can imagine, this graph is a mess when trying to display it. I'd really like to display the graph, separated into ...
48
votes
2answers
10k views

How can I use Mathematica's graph functions to cheat at Boggle?

Boggle is a word game played with 16 dice and a 4x4 tray. This question is inspired by a Stack Overflow question about Boggle that I decided to solve using Mathematica. In addition to Mathematica, I ...
4
votes
1answer
306 views

Removing edge weights from a Graph

How can I remove EdgeWeights from a Graph without affecting any other properties of the graph? Let's construct a graph with ...
1
vote
1answer
72 views

Changing the size of arrows in a directed graph?

How can I change the size of arrows in a directed graph? By default, the arrows are too big and clutter the graph.
2
votes
0answers
62 views

Belief Network, Bayesian network

There is already a question about simulating Bayesian networks with Mathematica (Mathematica Package for Bayesian Networks). However, are there any packages or approaches which help in computing the ...
3
votes
4answers
464 views

How to find a path that traverses each edge of a graph exactly twice?

I have a question regarding a graph traversal problem. This is the graph I am working with: ...
6
votes
3answers
480 views

How to extract edgeweights from a graph

I have a graph with weighted edges, and I'd like to obtain the edge weights of the edges in the graph. Is there a nicer way of doing this than getting the ...
0
votes
0answers
29 views

“Partial” graph layout (with a fixed core)?

Is there a way to apply a graph lay out algorithm to a Graph object in such a way that a subset of its vertices and a subset of its edges are fixed beforehand, and ...
1
vote
0answers
47 views

Finding optimal inclusion cutoff to define subgraph of a “large” weighted graph

I have a weighted graph G with ~2.5K vertices and ~250K edges. (The edge weights are all in (0, 1), and the weight of each vertex is derived as the maximum of the ...
2
votes
0answers
59 views

Finding quasi-cliques

Is it possible to find quasi-cliques in a graph in Mathematica 10? I don't think it has been implemented, so are there any solutions to do this? Or do I have to export the graph data somehow and do ...
1
vote
1answer
48 views

How to invoke default VertexShapeFunction and EdgeShapeFunction from custom ones?

For this question, g is a Graph object (of order ~2K) such that the VertexWeight and ...
1
vote
1answer
53 views

Graph objects for LineGraph

When I enter for example G = Part[GraphData[10],1]; LG = LineGraph[G]; I get error message that LineGraph requires a graph ...
9
votes
1answer
1k views

Drawing a graph with specified edge lengths

I was wondering if it was possible to ask Mathematica to draw a graph provided some set of vertices: $(v_1, ..., v_N) \in V$ connected by $M$ edges $(e_1, ..., e_M) \in E$, where the length of each ...
11
votes
2answers
206 views
1
vote
0answers
124 views

Replace part in a matrix that matches specific pattern

I have the following problem. Given a matrix L which looks as follows, Matrix L is a link, route matrix. Further, I got the following vector (d), which indicates the demand per vertex combination. ...
2
votes
2answers
152 views

Speeding up the generation of all k-edge-coloring of a graph

A $k$-edge-coloring of a graph $G=(V,E)$ is a function from $E$ to $\{1,\ldots,k\}$, so in other words every edge of $G$ receives one of the $k$ colors available. (In particular, note that we are not ...
1
vote
0answers
68 views

Spread multiple edges by a specified scaled distance (Mathematica 10)

Is there way to spread multiple edges by a specified scaled distance for Graph function in Mathematica 10, something similar to MultiedgeStyle in GraphPlot for example, I would like to write: ...
5
votes
2answers
224 views

How can I preserve the properties of edges of the original graph $g$ in a subgraph that doesn't include every edge of $g$?

The closest question to the following I could find was Preserving labels when using graph functions, but it doesn't seem to cover this. Consider a graph g where ...
8
votes
1answer
181 views

Vertex merging in graph?

Given a Graph such as the one produced with the following code ...
9
votes
4answers
291 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. ...