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
1answer
65 views

Generate list of traceable and planar graphs

Is there any way to tell Mathematica to generate a list of graphs that are both traceable and planar?
14
votes
2answers
304 views

Zoom in on a 2D graph

I have seen many queries on zooming in on plots etc. But I haven't seen any regarding 2D graphs. For eg if I have a graph like Graph[{1->2, 2->3, 3->1}]. ...
3
votes
1answer
149 views

Hasse Diagrams from Adjacency Matrix

Let's say I have a rather large adjacency matrix for a partial order relation. Say an 80x80 matrix. What is the best way to display Hasse diagram? I have tried AdjacencyGraph and it does a not so bad ...
15
votes
1answer
325 views

GeoGraphics : path within a country

I am using GeoGraphics to visualize electricity distribution networks in certain countries. I have susbtation location data, as well as network incidence matrices (...
8
votes
0answers
111 views

Deleting zero edges from a graph causes bizarre behavior

Bug introduced in 10.3.0 and fixed in 10.4. Consider the following (very simple) graph, with two vertices and one edge: g = Graph[{1, 2}, {1 <-> 2}]; I ...
20
votes
2answers
384 views

Reconstruct a graph from an image (curved edges and edge crossings)

Actually, I posted a very similar question before this.How to generate a Graph from a picture of a graph Dr. belisarius's answer have answered that question, but I find a limitation in that method: ...
1
vote
0answers
55 views

Is there a way to update a graph in place?

I'm assembling graphs programmatically, and looping through EdgeAdd[] a lot. graph = EdgeAdd[graph, a -> b]; Is there a more efficient way to do the updates ...
12
votes
1answer
266 views

How to generate a Graph from a picture of a graph?

I have a picture like this I can get this graph's vertexes ...
5
votes
2answers
132 views

How to use Mathematica to calculate number of spanning tree?

As the title,The graph g is: ...
1
vote
1answer
52 views

How to set color for some graph's vertex? [closed]

I defined graph and got this visualization ...
1
vote
1answer
78 views

Combinatorica and DualPartition function (for a Young diagram)

I am trying to understand how to evaluate the arm and leg functions of a Young tableaux using Mathematica. To do so I need the Combinatorica package. Then apparently the command ...
0
votes
0answers
85 views

How to graph the all of the possible isomorphic graph?

We can get one form of it use Graph ...
6
votes
2answers
63 views

How to specify custom graph styles for `GraphStyle`?

There is a way to specify custom themes for plots (Is it possible to define a new PlotTheme?), but themes to not apply to Graph objects, not even to ...
1
vote
3answers
58 views

How to draw graph with named vertices by adjacency matrix?

I have the adjacency matrix of graph and I want visualize this graph. I tried: ...
5
votes
1answer
159 views

What exactly does LocalClusteringCoefficient compute for directed graphs?

For undirected graphs, the LocalClusteringCoefficient of vertex v is ...
1
vote
1answer
100 views

Visualizing Matrix that represents a network

I have a nxn matrix $A$ that represents a network. I have $n$ nodes in the network, and the matrix $A$ represents the number of connection (edges) between the different nodes. For example, if $A$=0, ...
10
votes
1answer
402 views

Shortest tour with vertex priority

I changed the title of my question and tried to simplify formulation of the problem. I solve a very big vehicle routing problem. I divided this one big problem on many small sub-problems. Each small ...
6
votes
1answer
116 views

Networkgraph, Thickness of edges based on calculated values

On this blogsite I've read a interesting blog about visualising a correlation matrix. So I started with a simple file like: ...
4
votes
1answer
281 views

Graphs in 3 dimensions

I have a desired graph as here: the dashed line is just for perspective representation. I tried with LayeredGraphPlot and ...
1
vote
1answer
87 views

Labeling the vertices of a graph

I would like to label the vertices of a complete graph alphabetically. But I am stuck because I don't know how to associate only one vertex to a letter. ...
1
vote
1answer
113 views

Import graphml file in mathematica

I am trying import a graphml file I created with NodeXL in mathematica in order to create a network. However when i try to import it I get the error message: "Cannot import data as GraphML format". ...
8
votes
1answer
165 views

Alignment of `TreePlot`

I want to construct a binomial tree using TreePlot but have troubles with the alignment. The code ...
1
vote
1answer
44 views

Medium-sized graph won't build

Why can't Mathematica import a 40-KB file (mediumEWD.txt) and build the underlying graph in some decent time? I waited a minute, nothing. ...
2
votes
1answer
57 views

Highlighting a graph with non-trivial vertex definitions

When defining a graph whose vertices are sets e.g. the Kneser graph, how does Mathematica interpret the vertices? I am having trouble highlighting vertices when I define vertices with sets, but for ...
1
vote
1answer
69 views

Vertices overlap with vertex labels

How to prevent a behavior on a picture below? Why vertices overlap with vertex labels? ...
0
votes
1answer
54 views

How to change vertex font size in TreeGraph?

I tried to change vertex label font size by the following code ...
4
votes
1answer
82 views

How do I change one edge in a tree graph to a double arrow?

I use the following code plot a binary tree and wants to change an edge to double arrow. ...
2
votes
1answer
220 views

Draw a de Bruijn graph with random vertex size

I am trying to draw a graph that looks like below, This the code I have so far, ...
11
votes
2answers
125 views

EdgeAdd function not adding edges to a RandomGraph[ ]

Bug introduced in 9.0 or earlier and persisting through 10.3.1 I have a graph: g = RandomGraph[{1, 0}] So basically, it is just one vertex. I want to add some ...
3
votes
1answer
87 views

Deleting isomorphic graphs efficiently

I'm trying to delete isomorphic graphs from a large list. My solution is as follows: DeleteIsoG1[gl_List]:= Module[{}, DeleteDuplicates[gl,IsomorphicGraphQ]]; ...
0
votes
1answer
73 views

Getting error from CommunityGraphPlot

Situation I'd like analyse my web site with CommunityGraphPlot as follows: Step 1: Define a function to scrape the all the webpages from expected website. ...
2
votes
1answer
68 views

Deleting Isolated subgraph in a graph

Suppose I have a graph GraphPlot[{1 -> 2, 2 -> 1, 3 -> 1, 3 -> 2, 4 -> 1, 4 -> 2, 4 -> 4, 5->6}] Now I want to identify the vertices of a subgraph which are isolated from the main graph.(In this case ...
3
votes
1answer
73 views

Cannot get Mathematica to recognise Vertex Weights of Graph

I am using Mathematica Version 8.0 I've tried variations of the following commands, in order to assign the weight $1/k$ for vertex $k$, for a graph defined on {1,2,..,n} via the edge rule $$(k,k') \...
3
votes
1answer
78 views

Generate all directed graphs with n vertices, + additional constrains

I have a problem similar to Using GraphData to generate all directed graphs with n vertices. That is, I want to have all directed graphs with n vertices (particularly, for n = 4). However: not up ...
9
votes
0answers
97 views

Set new edge capacity

Bug introduced in 9.0 or earlier and persisting through 10.3.1 I am trying to add a new edge to an existing graph and set its capacity, but for some reason the ...
2
votes
3answers
91 views

network visualization with different colors for different edge labeled

I have a network with 3 different edge types, edgelist file is a three column file with id1, id2 and edge label. I uploaded the file here What I need know is to find a way to plot this network, as ...
4
votes
2answers
113 views

How to plot a graph with some disconnected vertices?

I am trying to plot a graph with $6$ vertices but I do not want some of the vertices to be connected. I have drawn a picture to illustrate my problem. So far I know how to plot $6$ vertices without ...
3
votes
2answers
144 views

How do I find all cut vertices (aka articulation points) in a graph?

Given a connected graph $G = (V,E)$, we say that a vertex $v \in V$ is a cut vertex of $G$ if the removal of $v$ from $G$ causes $G$ to become disconnected. How can I find all cut vertices of a given ...
1
vote
1answer
54 views

what causes this display problem (missing arrows) with this adjacency graph [duplicate]

AdjacencyGraph[{{1, 1, 0}, {0, 0, 1}, {0, 0, 1}}, DirectedEdges -> True] If you look very closely at the resulting visual display in a notebook (below), you ...
8
votes
1answer
97 views

Smallest connected subgraph containing all given vertices

Given a connected graph $G$ and a subset of its vertices, $S$, I need to find the smallest connected subgraph of $G$ containing all of $S$. How would you approach this in Mathematica? I am asking ...
3
votes
2answers
63 views

Spatial Display of “Union of Geodesics” in a Random Geometric Graph

After reading.... Finding all shortest paths between two vertices which addresses an important topic in Mathematica graph visualisation, I use ...
1
vote
0answers
57 views

Visualizing site map using a Tree

I've been trying to visualize a sitemap for analysis purposes. So far, using Leonid Shifrin's makeTreeRojo function, I've been able to build a somehow decent visualization. First, I fetch and format ...
5
votes
1answer
240 views

Finding a complete subgraph efficiently

I'm working on some experimental algorithms which would benefit from methods to find an instance of complete subgraphs with N vertices in an undirected graph. This far I've tried these methods: <...
1
vote
2answers
217 views

Chromatic number for “great circle” graph

I would like to calculate the chromatic number for a great circle graph. I tried this example in this link. I first tried to calculate the chromatic number for ...
2
votes
1answer
68 views

Changing edge weights in a graph using PropertyValue

I encountered a problem trying to change the EdgeWeights in a graph. I am runnning Mathematica 10.1 under Windows 7 Enterprise. I have an undirected graph with 144 nodes and 576 edges. I first ...
1
vote
0answers
43 views

Depth limited search in mathematica

I often use FindPath[G, 1, 2, {L}, All] where $G$ is some graph. This finds all paths of length exactly $L$ edges which run between nodes $1$ and $2$. In large ...
1
vote
0answers
80 views

Mathematica in Action (Wagon) — code to generate a great circle is giving error [closed]

I have code from Stan Wagon's Mathematica in Action, Chapter 17 (Great Circle Problem), but when I try to run it, it does not work. I have Mathematica 10. The code that does not run is shown below. Do ...
10
votes
3answers
272 views

Custom edge style (e.g. brush stroke, writing ink, etc.)

I would like to draw a graph with Mathematica in such a way that it looks like a handmade drawing or painting. To be more precise, is there a way to set a custom edge style such that it looks made ...
1
vote
0answers
52 views

How to set distance between connected vertices in graph?

I'm new at making graphs in mathematica 9, so I don't know if this question is contained in some of already asked ones. I started making it to visualize a polytope, which is build by a sertain ...
3
votes
0answers
58 views

How best to use or to emulate the “obsolete” Combinatorica command Contract?

The obsolete Combinatorica package has a command Contract for contracting an edge in a graph. Below is my very clunky attempt to work with up-to-date graph objects ...