# Tagged Questions

Questions about handling graphs in Mathematica, graph theory, graph visualization, GraphPlot, the built-in Graph type and the Combinatorica` package.

74 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') \...
80 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 ...
98 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 ...
92 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 ...
117 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 ...
150 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 ...
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 ...
102 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 ...
64 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 ...
58 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 ...
248 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: <...
224 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 ...
70 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 ...
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 ...
81 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 ...
285 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 ...
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 ...
59 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 ...
54 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: ...
32 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 ...
254 views

### Vertex descendants subgraph

Keywords: vertex, ancestors, descendants, subgraph, directed graph, flow subtree So let's say we have a TreeGraph: ...
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 ...
50 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 ...
85 views

The graph ...
163 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 ...
223 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 ...
164 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 ...
192 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: ...
86 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 ...
75 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 ...
84 views

### How to use the “EdgeLayout” suboption of GraphLayout?

According to the documentation, GraphLayout has an EdgeBundling suboption, which can take the following values: ...
53 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 ...
257 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 ...
179 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, ...
71 views

### LayeredGraphPlot how to change color of vertex box

For LayeredGraphPlot how to change the default yellow color? ...
84 views

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

Suppose I have an undirected graph ...
120 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 ...
59 views

### How to draw vertices with identical names multiple times?

I have a list of rules that I would like to show as a layered graph. However, some vertex names appear more than once. How would one best deal with this situation? Example: ...
95 views

### Is there a way to efficiently generate a large “incomplete” k-partite graphs

A complete k-Partite graph can be divided into "k" distinct sets of nodes, each of which is connected to all nodes not in its own set. This can be generated with code CompleteGraph[{an, bn, cn}] ...
130 views

### Number of 4-colorings of Johnson solids

I want to know the number of 4-colorings for all Johnson solids. This is equivalent to evaluating the flow polynomial for the corresponding polyhedral graphs at $k=4$. I tried the following to get ...
103 views

### Weighted and directed network computation in Mathematica

Is there any set of commands in Mathematica to compute mean shortest path, global clustering coefficient, diameter and radius of the network, etc. for weighted and/or directed graphs? There indeed ...
140 views

### How can I route edges manually for a Graph?

Most graph layouts supported by Mathematica use straight lines for edges; or at least something that only depends on the coordinates of the two adjacent vertices of the edge and nothing else. A ...
197 views

I have what it seems to be a very trivial question, but after searching for hours I was not able to find an answer, so I am asking here. I have an edgelist for a graph, a 2 column csv file with id1,...
519 views

### Import and Plot Git Commit History

What might be the easiest to import and plot all commit history for a github project? I'm looking for something similar to the following.
93 views

### More efficient way to generate lattice graph with edges between visible vertices?

Given a nXn lattice, I need to generate the graph such that there is an edge between two vertices iff they are directly "visible" to each other, i.e., there is no vertex between them. I'm using <...
52 views

### Converting from GraphData to graph object

I know this is a simple question, but suppose I have a graph G = Part[GraphData[n],i] How do I convert this into a graph object accepted by ...
95 views

### Lack of arrows in Markov Chain graphs

I'm following this: http://www.wolfram.com/mathematica/new-in-9/markov-chains-and-queues/structural-properties-of-finite-markov-processes.html When I try to graph the Markov chain with Graph[proc] I ...
70 views

### How do I import a non-directed graph in graphml format?

I have created a graph with undirected edges, and I'm trying to import it into Mathematica. However, when I import it, I get directed edges. ...