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)

0
votes
0answers
4 views

Click required before ViewVector behaves in Graph3D (Also, how to view 3D subgraph “head on,” retaining original VertexCoordinates)

My overall goal for the following is to produce 3D subgraphs with some vertices deleted that looks "head on" at the remaining vertices, which are held in their original positions via ...
9
votes
2answers
437 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 ...
11
votes
2answers
332 views

Determining whether two $k$-chromatic graphs are isomorphic (respecting vertex coloration)

Consider the case where I have two $k$-chromatic graphs $G_1$ and $G_2$, i.e. two graphs where individual vertices can be colored with one of a set of $k$ total colors, and I would like to determine ...
2
votes
0answers
33 views

Algorithm to determine if two colored graphs are isomorphic? [duplicate]

I have two (vertex-)colored graphs. I want to determine if they are isomorphic, with the condition that the isomorphism respects the colors of the vertices. Moreover, I want the algorithm to output ...
10
votes
2answers
388 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 ...
31
votes
4answers
5k 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 ...
5
votes
0answers
87 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 ...
11
votes
4answers
424 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
77 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
77 views

How to show the direction of highlighted path in graph

I am trying to show the direction of FindHamiltonianPath on the Graph. ...
1
vote
0answers
57 views
5
votes
1answer
89 views

Vertex Order of Graph

Given a graph, I want to find the shortest distance between each pair of vertices: ...
3
votes
0answers
47 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
67 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
178 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 ...
1
vote
1answer
50 views

Unexpected AdjacencyMatrix output [duplicate]

I have a directed graph with this Edgelist defined as follow: ...
2
votes
2answers
61 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
39 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
526 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
147 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
61 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
71 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
84 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
57 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
121 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
77 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
142 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
586 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
92 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
222 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: ...