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
0answers
84 views

Finding quasi-cliques

What is the best way to identify quasi-cliques in a graph in Mathematica? 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 ...
10
votes
4answers
418 views

Efficient setting of properties of multiple vertices in Graph

The functions SetProperty and PropertyValue can only set a single property of a single vertex, as far as I know. How do I set a ...
2
votes
1answer
70 views

Multiple colors on a single graph edge?

Is there any way to put two colors on one single graph edge? For example, I want to highlight two cyclic paths (red and blue). But, if I put the two colorings into one image, it does not work as I ...
5
votes
2answers
69 views

How to show the direction of highlighted path in graph

I am trying to show the direction of FindHamiltonianPath on the Graph. ...
0
votes
0answers
49 views

GraphDistance gives incorrect result in weighted multigraph [on hold]

There are bugs in Graph on Mathematica 10.1. For example, ...
5
votes
1answer
88 views

Vertex Order of Graph

Given a graph, I want to find the shortest distance between each pair of vertices: ...
3
votes
0answers
45 views

Issues adding properties to multigraph

Today I was working with a large multi-graph with properties on the edges when I discovered that properties aren't assigned as expected. My preferred graph construction method is to specify ...
3
votes
2answers
64 views

How to specify different colors for edges going between the same two vertices in Graph?

Here is an example: edge1 = Property[1 -> 2, EdgeStyle -> Red]; edge2 = Property[1 -> 2, EdgeStyle -> Blue]; Graph[{edge1, edge2}] This does not ...
5
votes
1answer
176 views

Calculate dual graph of planar Graphics map

This diagram from a Wikipedia article illustrates what I hope to accomplish in Mathematica: I have a planar map in Graphics format. Here are two very simple ...
2
votes
2answers
63 views

How-to let user define a set of VertexCoordinates in a Graph

Here is a simple code I wrote to visualize what I am trying to achieve: C.1 ...
7
votes
2answers
412 views

Sierpinski carpet with GraphData

Is this graph in the list among the so-called "standard" structures used in GraphData? However, I have not found, yet, anything like "Carpet" or "Sponge" in the ...
1
vote
1answer
48 views

Unexpected AdjacencyMatrix output [duplicate]

I have a directed graph with this Edgelist defined as follow: ...
2
votes
2answers
60 views

Recursive graph expansion and rewiring

I want to take this graph and convert it into this graph by repeatedly substituting each of its nodes according to this rule After loading the initial graph and the substitution rule ...
24
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 ...
1
vote
1answer
38 views

How do I customize vertex label texts in tree plot correctly?

By the following code TreeGraph[{1, 2, 3}, {1 -> 2, 1 -> 3}, VertexLabels -> {"a", "b", "b"}] I get . This is incorrect. I need "a" to label the vertex ...
1
vote
2answers
85 views

Graph generation from a non-paired edge list

The elements in e = {{6414, 6598, 6927}, {7, 1035, 2382, 6927}, …} are the graph nodes; for example, {6414,6598,6927} is ...
4
votes
1answer
84 views

How can I change VertexWeights in a Graph?

Bug introduced in 9.0 or earlier and fixed in version 10.0.0 I evaluate ...
4
votes
1answer
122 views

Is there really a bug in the following code, taken from the reference documentation for PetersenGraph?

Bug introduced in 9.0.0 and fixed in 10.0.0 PetersenGraph[5, 2, EdgeLabels -> {8 \[UndirectedEdge] 9 -> "hello"}] appears to evaluate perfectly, as ...
10
votes
3answers
524 views

Mathematica 10 Graph issue

Bug introduced in 10.0.0 and fixed in 10.0.2 Please try to evaluate this code in Mathematica 10. ...
0
votes
1answer
146 views

Using different colors in TreeForm?

I've used TreeForm, and I appreciate that the syntax is fairly short, especially in comparison with TreeGraph. Is it possible ...
1
vote
2answers
109 views

Styling the edges of a graph according to the multiplicities of the edges

I used the following code to make a simple triangle, in which the nodes have different effects each other: ...
6
votes
0answers
60 views

Functionality of FindMaximumFlow

I know that the superseeded function NetworkFlow (needs Combinatorica) uses Goldberg-Tarjan's Push-Relabel-Algorithm but i cant find any information on Mathematica's built-in-function (...
2
votes
0answers
69 views

What Algorithm Does Mathematica use to Calculate Betweenness Centrality for Unweighted Graphs?

I recently asked this question on the Mathematics SE. Does anyone know, as a follow up, what algorithm Mathematica uses to calculate the betweenness centrality vector (of $N$ elements) for an ...
3
votes
0answers
72 views

How to extract a Graph[] from an image?

This graph (as a picture) is given below: I am wondering rather than setting up this network graph using Mathematica syntax such as PathGraph,...
1
vote
1answer
83 views

How to find a cycle with a property in a graph

Let's have a graph with this edge list: edgelist = {s -> 1, s -> 2, 1 -> 3, 2 -> 1, 2 -> 4, 3 -> 2, 3 -> t, 4 -> 3, 4 -> t}; I want ...
1
vote
1answer
55 views

calculate relationship between cause and effect (rows/columns/delta etc.) on tableform

I tried to enter this Excel (on the right of the picture) information to program. following these codes has been used: ...
6
votes
2answers
78 views

Delete vertices of degree 2 and rewire graph

I want to delete all vertices of degree 2 from a graph and rewire it. Given a graph like graphA, I want to obtain graphB. ...
18
votes
1answer
188 views

Systemic bugs in GraphPlot and related functions such as TreePlot and TreeForm

Bug introduced in 7.0.1 or earlier and persisting through 10.2.0 I believe I have come across a rather curious bug in TreeForm: ...
12
votes
0answers
120 views

A question about weighted graphs

Bug introduced in 8.0 or earlier and persisting through 10.2 or later I need create a weighted graph with given data. Number of nodes: $53$ $\quad$ Number of edges: $91$ ...
12
votes
2answers
329 views

Why is NeighborhoodGraph so slow?

To get neighboring vertices I first tried: gg = GridGraph[{10, 10, 10, 10}]; VertexList[NeighborhoodGraph[gg, 1, 1]] // AbsoluteTiming {5.539308, {1, 2, 11, ...
3
votes
2answers
156 views

CommunityGraphPlot doesn't size

Bug introduced in 9.0 and fixed in 9.0.1 When I need to plot a 'large' graph with CommunityGraphPlot the output is always sized at the Mathematica default value. The Graph object itself can be ...
4
votes
1answer
142 views

References on functions FindGraphPartition and FindGraphCommunties

Does somebody have some interesting references on the FindGraphPartition and FindGraphCommunties[.., Method -> "Spectral"] ...
0
votes
1answer
54 views

How to check if (u,v) and (v,u) edges are in a given directed graph

I have a graph and i want a module to run through all the edges of this graph and check whether (u,v) edge is in this graph and (v,u) edge is in another given graph.
5
votes
1answer
84 views

How to create a MorphologicalGraph from MorphologicalBranchPoints

I want to select the morphological branch points of a thinned image to create a MorphologicalGraph like the one obtained by Pruning. I want to avoid the pruning step. How can I delete from the ...
3
votes
2answers
76 views

Coloring network edges by weight using GraphPlot

Following up on a previous question about how to color the nodes (vertices) of a network (graph) according to a color scaling of a property of those nodes, I'm now asking basically the same thing ...
8
votes
2answers
140 views

Efficient solution for a discrete assignment problem with pairwise costs

Let's consider a simple graph with N vertices, and a corresponding set of N items. The goal of the problem is to assign every item to a vertex on the graph so that sum of a per-edge (that is ...
10
votes
2answers
583 views

HighlightGraph with different styles

I want to highlight two different directed paths on a graph with two different style. I am using the following two code snippets: ...
0
votes
0answers
29 views

Weighted graph vizualization [duplicate]

Is it possible to visualize a weighted graph, so lines on screen would reflect weight? I.e., be longer, or shorter depending on edge weight? Slight OT: which graph visualising libraries/tools can do ...
21
votes
2answers
1k views

Drawing pairs (planar graph, circle packing)

Circle packing theorem states: For every connected simple planar graph G there is a circle packing in the plane whose intersection graph is (isomorphic to) G. How to use Mathematica to draw examples ...
10
votes
1answer
91 views

IsomorphicGraphQ fails to recognize that two empty graphs are identical

Bug introduced in 9.0.1 or earlier and persisting through 10.2.0 Consider the following two graphs: ...
7
votes
1answer
97 views

Setting PropertyValue for VertexWeight is not persistent

Bug introduced in 9.0.2 or earlier and fixed in 10.0 ...
9
votes
2answers
219 views

Self-loops in Graph may not display correctly or export correctly to PDF (due to BezierCurve problem)

Bug introduced in 10.0 and persisting through 10.2.0 Problem is due to a BezierCurve bug. I don't understand why the following does not work: ...
9
votes
1answer
129 views

FindHamiltonianCycle is not invariant to edge permutation

Bug introduced in 9.0.1 or earlier and fixed in 10.0 Found this bug-like behaviour today: if the order of edges is changed so that VertexList does not return the ...
10
votes
2answers
196 views

Finding the minimum vertex cut of a graph

Bug introduced in 9.0.1 or earlier and fixed in 10.2.0 Note: FindVertexCut is new in 9.0. It seems that Mathematica is not correctly finding the smallest set of ...
6
votes
0answers
51 views

VertexDelete not working on graph with VertexWeight

Bug introduced in 10.0 and persisting through 10.2.0 Good afternoon, I have observed an "unexpected behaviour" with VertexDelete and a graph with vertex weights. This is a minimal working example: ...
11
votes
1answer
85 views

Question about TransitiveReductionGraph

Bug introduced in 10.0 and persisting through 10.2.0. Note: TransitiveReductionGraph is new in 10.0. In Mathematica 10.0 and 10.1, according to the ...
0
votes
1answer
32 views

How to perform operations with vertices from any edge on a Graph object

I'm trying to get the vertices from an large list of edges on a Graph object in Mathematica 10. I need to operate them, adding, substracting dividing. As an ...