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)

5
votes
4answers
105 views

Vertex styling in CommunityGraphPlot

Is there a way to change the colours of nodes within one community? Mathematica assigns vertex colours automatically to each community. However, I'd rather like to use my own colour set. ...
22
votes
1answer
368 views

Visual representation of a Ranking over time (image provided)

[Disclaimer: I initially posted this question on stackOverflow 2 months ago and think it might be better suited for this forum (link to original question)] The graph below shows a ranking of ...
0
votes
1answer
41 views

How to query W|A, to get a list of asymmetric, bicubic and $3$-edge colorable graphs? [closed]

I'm interested in finding graphs with certain properties, like the smallest cubic bipartite asymmetric graph. While working on a related graph-theoretic problem, concerning edge-colrings, I came along ...
1
vote
2answers
69 views

Insert an element to AdjacencyGraph

I'm not able to insert an element to mine AdjacencyGraph. I suppose that i should modify my AdjcencyMatrix: ...
4
votes
2answers
129 views

Using VertexDelete to remove vertices by degree

I am trying to remove vertices that have degree less than 2, but I think I am missing something basic. I was hoping that I could use: ...
1
vote
0answers
44 views

Purpose of VertexWeight

I am trying to partition a graph into partitions of equal weight (on the vertex). I looked at the documentation, and found VertexWeight, which seems to attach a weight to a vertex. In the details, ...
1
vote
0answers
55 views

Multi-named Nodes (or Overlapping Nodes) in TreePlot, or Merging Trees

If there is a series of rules from which a TreePlot is made: {D->C, C->B, B->A} And a new node is added that is technically the same as an existing ...
27
votes
4answers
4k views

Finding all shortest paths between two vertices

The built-in FindShortestPath and GraphDistance functions find the shortest path between two particular vertices in a graph. I ...
9
votes
3answers
301 views

Label multiple edges between same vertices

I have a simple graph with multiple edges between two vertices, say: Graph[{ Labeled[a -> b, "A"], Labeled[a -> b, "B"] }] Unfortunately, Mathematica ...
3
votes
1answer
56 views

Change group generators?

I want to make Cayley graphs for the same group, but with different generators. Is there any way to represent a group, besides a cumbersome permutation representation or using the default Mathematica ...
1
vote
1answer
258 views

How to implement the directed Barabasi-Albert algorithm in Mathematica?

Does anyone know how to implement an efficient version of the [directed Barabasi-Albert algorithm][1] in Mathematica that scales until hundred of thousands nodes? The directed network mechanism is ...
3
votes
1answer
67 views

AdjacencyMatrix: Unexpected output

I have a graph defined as follow: ...
17
votes
4answers
831 views

How to find all vertices reachable from a start vertex following directed edges?

How to find all vertices reachable from a given start vertex following directed edges, in a cyclic directed graph given as ...
1
vote
1answer
69 views

How to insert Tooltip into incidence plot?

I'm trying to make a graph using a file .NET extracted from a file .CSV and to make tooltiped the vertices' labels. Initially I ...
3
votes
2answers
68 views

IsomorphicGraphQ giving an error when the graphs contain multi-edges

If I run IsomorphicGraphQ on the following graphs, I get an error I don't understand: ...
2
votes
1answer
51 views

AdjacencyList of DirectedEdges in Graph ignore edge direction

I have a simple tree graph with directed edges: In: AdjacencyList[Graph[{a -> b, a -> c, b -> d, b -> e}], b] Out: {a, d, e} I wonder how I can ...
2
votes
1answer
59 views

Specifying the style of edges in directed graphs [closed]

How do I specify the style of individual edges in a directed graph (in Mathematica version 9)? Consider maybe this ...
0
votes
0answers
56 views

Is it possible to use EdgeCapacity in FindMinimumCostFlow?

I'm having trouble getting the EdgeCapacity feature in FindMinimumCostFlow to work. I have attached a simple example. We have a simple graph of four vertices. There are two paths from the "source" ...
0
votes
1answer
55 views

FindCycle not working as expected for multigraph

Say I have a simple multigraph like so: edges = {DirectedEdge[a, b], DirectedEdge[b, c], DirectedEdge[c, a]}; g = Graph[Join[edges, edges]] ...
1
vote
0answers
36 views

Export format for graphs loses type information?

I have a situation where I am adding properties to vertices in my graph. In my case, I am adding a moduleId, which is an integer, and a kind, which is a string. I attach a weight to the edge as well. ...
2
votes
0answers
46 views

Bugs in VertexContract function?

I think there may be two bugs in the VertexContract function: 1) The updated graph does not include reasonable edgeweights 2) The function does not actually reduce the number of vertices in the ...
2
votes
1answer
159 views

Dynamic process on graph

I have a question, which I failed to find an answer to myself. I'm a casual user of Mathematica, but do have some knowledge about Dynamic module and other "Advanced" features. My problem is ...
2
votes
1answer
63 views

Finding if a graph contains an even cycle

I am looking for a simple boolean-like function which could check if a graph contains an even cycle. I'm aware there is ExtractCycles but I'm looking for a true/false output than a list of cycles.
2
votes
1answer
124 views

Intelligent vertex placement in large tree graphs

This question about graph layout is fairly general, but can be illustrated in the case of the Collatz Conjecture. Collatz created the following function over integers greater than 1: If the integer ...
3
votes
1answer
78 views

How to change the vertex shape

(Using V9 on Ubuntu) Consider the following code, to create a graph. ...
1
vote
1answer
102 views

(Tree) Graph Layout

I am trying to draw a graph in a tree-like form. I can't use TreeGraph because what I am drawing is not properly a tree (has loops) so TreeGraph won't draw it. Here is the code: ...
2
votes
1answer
71 views

Overlapping EdgeLabels

I have to make a directed graph for a maximum flow algorithm assignment. Although I have managed to make the graph for the better part, it still needs some work. The problem is that Mathematica ...
3
votes
2answers
121 views

Slow rendering in GraphPlot3D

Is there a way to speed up this rendering? I have to make this call many times in order to make an animation of some dynamics on the graph g. Thus dynamics are carried in the list var. Each entry in ...
1
vote
1answer
84 views

Coloring vertices according to a function using GraphPlot3D

This question is similar but not identical to a related question called: coloring-vertices-using-graphplot . I need to color the vertices of a graph according to a function, f that is defined on the ...
2
votes
4answers
139 views

Invisible graph edges

I have a fairly sparse adjacency matrix for which I can draw the graph. Right now, two nodes $i$ and $j$ are connected, or not ($w_{ij} \in \{0,1\}$). However, I have come up with a way to define new ...
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
448 views

Mathematica 10 Graph issue

fixed in 10.0.2 Please try to evaluate this code in Mathematica 10. ...
3
votes
1answer
150 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
248 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
110 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
188 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
80 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
61 views

FindGraphCommunities method options?

FindGraphCommunitites has a couple of method options: "Modularity", "Hierarchical", ...
1
vote
3answers
82 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
80 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
63 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
64 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
145 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
115 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
87 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
88 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 ...
7
votes
0answers
41 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 ...