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)

1
vote
1answer
84 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
112 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
161 views

Alignment of `TreePlot`

I want to construct a binomial tree using TreePlot but have troubles with the alignment. The code ...
1
vote
1answer
43 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
64 views

Vertices overlap with vertex labels

How to prevent a behavior on a picture below? Why vertices overlap with vertex labels? ...
0
votes
1answer
47 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
219 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
86 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
70 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
58 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
71 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
76 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
93 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
90 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
107 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
136 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
53 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
94 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
62 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
55 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
188 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
215 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
63 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
42 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
79 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
257 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
51 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 ...
3
votes
1answer
52 views

TreePlot: arrows on specific lines

I have the following list of rules: L={1->2,2->3,3->3}; and I want to plot a tree graph: ...
1
vote
1answer
31 views

WeaklyConnectedGraphQ evaluates to False. Is this the expected result?

Take the simple graph {1->2, 2->3, 3->1}: TreePlot[{1->2,2->3,3->1}] I would expect that ...
11
votes
2answers
248 views

Vertex descendants subgraph

Keywords: vertex, ancestors, descendants, subgraph, directed graph, flow subtree So let's say we have a TreeGraph: ...
1
vote
1answer
34 views

Scan appears to work setting graph properties, but get error on property-read

This is a self-contained version of something a bit bigger - going for brevity. It is a bit synthetic, but there are applications I have in mind where the {{1,2}} will be replaced with real data, more ...
2
votes
1answer
49 views

Path with no dependence violations

I am guessing this will be a duplicate(it seems like a common task), but I obviously can't find the right page. I have a directed graph showing dependencies, and I want to list the vertices in an ...
5
votes
0answers
79 views
2
votes
2answers
151 views

How to find all possible paths with as many edges between two same vertices?

Suppose I have an undirected graph G = Graph[{1 <-> 2, 2 <-> 3, 2 <-> 3, 3 <-> 4}] I used ...
6
votes
2answers
216 views

Extract bibliography from a PDF document

I am trying to extract bibliographies from academic papers which are in pdf format, and I have to do this for 100+ papers. My goal is to create a network of citations amongst the authors and identify ...
6
votes
2answers
162 views

Grouping the list of numbers that have common.

I am working on some simple problem. It is like puzzle.. Let's say I have some list input={{1,1},{1,2},{1,3},{2,3},{3,3},{4,4}} Which means 1 can go and back to ...
4
votes
2answers
189 views

Ploting a parallel graph for an animation

I am sorry that my attempt to obtain a fully functional plot as I want failed badly because I am not able to integrate the features to the graph. Here is my simple code: ...
8
votes
1answer
76 views

Is there an easy way to set or retrieve a graph edge properties as a list, in a single go?

I am trying to use arbitrary edge properties in Graphs, and I am looking for easy ways to work with them. In many cases it would be convenient to be able to set ...
0
votes
1answer
71 views

Creating confidence interval plots for random graphs

I have the following code where I create instances of random graphs and use their properties to compute the mean of a quantity labeled 'PoA'. In the last line, I use a range of values for the ...
4
votes
1answer
83 views

How to use the “EdgeLayout” suboption of GraphLayout?

According to the documentation, GraphLayout has an EdgeBundling suboption, which can take the following values: ...
1
vote
0answers
52 views

Graph equivalent of GraphPlot's MultiEdge style?

I like the default display of Graph much better than that of GraphPlot, but I do not see how to turn off the use of multi-edges ...
8
votes
3answers
245 views

How to count all cliques (not just maximal ones) in graphs?

How can I count the numbers of $r$-cliques in a graph? In other words, the number of triangles, the number of $K_4$, the number of $K_5$ etc. I have tried for example ...
4
votes
1answer
155 views

Fast way to get edge-list of graph in terms of vertex indices (not vertex names)

I am looking for the fastest way to achieve the following: Given a Graph, retrieve its edge list in terms of vertex indices (not actual vertices). For example, ...
1
vote
1answer
67 views

LayeredGraphPlot how to change color of vertex box

For LayeredGraphPlot how to change the default yellow color? ...
2
votes
0answers
81 views

How do I get all possible paths in terms of edges, and not vertices in Mathematica?

Suppose I have an undirected graph ...
0
votes
3answers
109 views

How to Change Vertex List in a Grid Graph

I would like to actually change the vertices in a grid graph instead of simply changing the label. Ultimately, I want the vertices to be points on a plane. So if given a simple grid graph ...