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)

3
votes
3answers
57 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. ...
1
vote
0answers
46 views

LayeredGraphPlot Vertex Spacing

For anyone who has used LayeredGraphPlot, you have probably seen that the vertex spacing is consistent throughout, that vertices have the same minimum unit of ...
0
votes
1answer
34 views

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

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
59 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
39 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, ...
0
votes
0answers
38 views

How to recursively check is a graph is a binary search tree?

I'm having trouble using the built in DepthFirstScan[] to see if a tree satisfies the binary search tree property, the documentation is confusing. Motivation: I'm ...
1
vote
0answers
37 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 ...
4
votes
3answers
128 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
237 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 ...
0
votes
0answers
40 views

Independent Set Sorting

Let's say I have a graph g, and I wanted the largest independent vertex set of g. I would write then, ...
3
votes
1answer
46 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
56 views

AdjacencyMatrix: Unexpected output

I have a graph defined as follow: ...
0
votes
1answer
137 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
60 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 ...
1
vote
1answer
59 views

Distinguishing left from right adjacent triangles in triangle mesh

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
42 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
54 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
58 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
46 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" ...
3
votes
2answers
89 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
26 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
45 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
36 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 ...
1
vote
1answer
54 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.
4
votes
1answer
186 views

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

The following code generates a graph. ...
2
votes
1answer
92 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
64 views

How to change the vertex shape

(Using V9 on Ubuntu) Consider the following code, to create a graph. ...
1
vote
1answer
81 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
1answer
62 views

Normalize centrality measures

How I can normalise centrality measures? Can I use Normalize function? I give example of unnormalized measures ...
2
votes
1answer
62 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
110 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
63 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
127 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
35 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
133 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
39 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
64 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
52 views

FindGraphCommunities method options?

FindGraphCommunitites has a couple of method options: "Modularity", "Hierarchical", ...
1
vote
2answers
59 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
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
54 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
60 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: ...
3
votes
1answer
65 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
96 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
69 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
89 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 ...
5
votes
0answers
37 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
139 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
60 views

What graph distributions are available in Mathematica?

Where can I find a list of all the graph distributions available in Mathematica?
22
votes
1answer
324 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 ...