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
2answers
186 views

Using GraphData to generate all directed graphs with n vertices

Using Combinatorica, it was possible to generate unlabeled (non-isomorphic) directed graphs of $|V|=n$. Here the example is for $n=4$: ...
1
vote
1answer
66 views

Export and Import a list of graphs?

I want to export a list of graphs that come as output to my program. However, I tried exporting all the graphs as graphs using Map and an Export statement with "graph.gml" statement, but got an error. ...
1
vote
1answer
55 views

Is there a way to combine VertexLabeling->True and VertexLabels/Tooltip in TreePlot?

Basically, I'm trying to make Mathematica give me a tree with names inside the rectangles like so: ...while also having the properties of VertexLabels or Tooltip, which lets me place my mouse over ...
5
votes
4answers
109 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. ...
2
votes
1answer
255 views

LayeredGraphPlot Vertex Spacing / Edge Length

For anyone who has used LayeredGraphPlot (Mma v9), you have probably seen that the vertex spacing is consistent throughout, that vertices have the same minimum unit ...
0
votes
1answer
42 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: ...
1
vote
0answers
47 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
67 views

Multi-named Vertices (or Overlapping Vertices) in TreePlot/LayeredGraphPlot, or Merging Trees

If there is a series of rules from which a TreePlot/LayeredGraphPlot is made: ...
4
votes
3answers
240 views

Graph Coloring based on neighboring vertices? Cellular Automata

I would like to apply a majority rule cellular automata to graphs. Specifically, I would like to take a graph as input, and then define two functions, InitialColoring[graph] and MajorityRule[graph]. ...
9
votes
3answers
324 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
62 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 ...
3
votes
1answer
69 views

AdjacencyMatrix: Unexpected output

I have a graph defined as follow: ...
1
vote
1answer
287 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 ...
1
vote
1answer
71 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 ...
2
votes
1answer
160 views

Distinguishing left from right adjacent triangles in triangle mesh [closed]

What I'm trying to do: I'm trying to create a path-drawing function which will produce a path like the one I-P in the diagram below. The way this path was generated requires me to swap between the ...
2
votes
1answer
52 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
60 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 ...
3
votes
2answers
81 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: ...
0
votes
0answers
58 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" ...
4
votes
2answers
134 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
37 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. ...
0
votes
1answer
59 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]] ...
2
votes
0answers
49 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
64 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.
5
votes
1answer
262 views

Is it possible to draw a curved edge between two vertexes of a graph? [duplicate]

The following code generates a graph. ...
4
votes
1answer
150 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
83 views

How to change the vertex shape

(Using V9 on Ubuntu) Consider the following code, to create a graph. ...
1
vote
1answer
112 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: ...
0
votes
2answers
97 views

Normalize centrality measures

How I can normalise centrality measures? Can I use Normalize function? I give example of unnormalized measures ...
2
votes
1answer
75 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
125 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
87 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
141 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
47 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 ...
3
votes
1answer
154 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. ...
2
votes
1answer
131 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: ...
3
votes
0answers
63 views

FindGraphCommunities method options?

FindGraphCommunitites has a couple of method options: "Modularity", "Hierarchical", ...
1
vote
2answers
85 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 ...
1
vote
0answers
84 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
68 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
66 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: ...
4
votes
1answer
91 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 ...
5
votes
3answers
197 views

Drawing a graph with vertex avoiding edges? (Handling vertices that must be colinear?)

I'd like to draw something like the following graph: ...
3
votes
1answer
95 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 ...
0
votes
1answer
125 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 ...
7
votes
0answers
42 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 ...
5
votes
2answers
146 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
0answers
63 views

What graph distributions are available in Mathematica?

Where can I find a list of all the graph distributions available in Mathematica?