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
2answers
127 views

Converting polygon to graph in V7

I've unsuccessfully tried many ways of converting polygon points into a graph using Mathematica 7, and I am frustrated. I looked at this post, but it doesn't work: ...
8
votes
2answers
881 views

Dynamic graph visualisation using JLink/Java and GraphStream

Visualising the addition of new nodes and edges to a graph to 'watch it grow' is to something Mathematica is not suited to by default. However this type of animation really helps convey the emergence ...
1
vote
1answer
2k views

I want to draw a graph using a weighted Adjacency matrix

I have a weighted adjacency matrix as follows: ...
2
votes
0answers
269 views

Why my Mathematica 9.0.1 wont work with some samples of Mathematica in Graph Theory?

I updated my Mathematica recently to 9.0.1 cause the previous version was giving me freaky result especially in FindMinimumCostFlow and ...
5
votes
1answer
415 views

How can I draw a polygon from a set of angles?

In recreational mathematics, polytans are polygons formed by edge-connecting isosceles right triangles. Order-n polytans are those constructed from n such triangles. My question is this: Given a ...
0
votes
0answers
37 views
1
vote
1answer
129 views

How can I change the Graph required data such as EdgeWeight,VertexWeight,EdgeCapacity,VertexCapacity in the Graph?

I asked this question in different form and because I couldn't receive the proper answer so I have to change my question.I know that was my fault sorry.I need to change the Matrix Data of nodes and ...
0
votes
2answers
223 views

How can I give graph required data with GUI?

Consider that I have the simple graph of ...
4
votes
2answers
219 views

Convert Graph to Graphics

In Mathematica 9, a graph is returned as an object with head Graph: In[8]:= CompleteGraph[8] // Head Out[8]= Graph ...
13
votes
1answer
495 views

How can I conveniently call igraph through RLink?

Mathematica has lots of functions for working with graphs, but this functionality is not yet as mature as the igraph library. It is useful to have access to igraph from Mathematica, both for ...
1
vote
1answer
247 views

Adjacency Matrix for an Undirected Graph

Here is an undirected graph ...
3
votes
0answers
90 views

shortest paths in probabilistically weighted edges? [duplicate]

I understand Mathematica can find shortest paths. However, is it also able to find the most probable paths? I mean this is a case where edges are given probabilistic wights (from 0 to 1) and the most ...
1
vote
1answer
116 views

How can I stop DiscreteMarkovProcess[] from relabeling vertices?

I'm attempting to calculate the mean first passage time between two vertices, $v_1$ and $v_2$, provided some undirected graph $G$. However, I noticed that running the following script: ...
1
vote
0answers
74 views

What algorithm is Mathematica using for FirstPassageTimeDistribution[]?

What algorithm is Mathematica 9 using for FirstPassageTimeDistribution[]? Is it attempting to use PseudoInverse[] on the ...
0
votes
2answers
92 views

How can I efficiently and uniformly sample the set of vertices a fixed edge-wise distance away from a chosen vertex?

I have a large graph $G$, which may be either directed or undirected. How would I use DepthFirstScan[] or BreadthFirstScan[] to ...
0
votes
2answers
239 views

Draw network graph and get the coordinates of each node

I would like to draw an undirected graph by specifying the nodes and the edges among them. This is currently done by, for example: ...
0
votes
1answer
121 views

How can I extract coordinates of the nodes of my graph?

I have this output for my graph. ...
2
votes
3answers
230 views

Drawing a complete graph of an ego network

I have an ego network (a network of a person (ego) and his friends). It is drawn with the ego at the center surrounded by the friends. It might be possible that all the friends are connected to each ...
2
votes
0answers
121 views

Fast calculation of commute distances on large graphs (i.e. fast computation of the pseudo-inverse of a large Laplacian / Kirchhoff matrix)

I have a large, locally connected and undirected graph $G$ with $\approx 10^4$ vertices and $\approx 10^5$ to $\approx 10^6$ edges. Moreover I can bound the maximum vertex degree as $Q_{max}$. I ...
7
votes
0answers
249 views

Caching of Graph Graphics

In this answer, Simon Woods concludes that when you display an expression with head graph more than once, something is getting stored somewhere. I looked into it too and found out this only happens if ...
6
votes
3answers
209 views

Converting Mesh in Density Plots to a Graph

Consider the following line of code: ...
4
votes
0answers
206 views

Counting paths of a certain length between a source and sink vertex

I have a graph $G$, which may be directed or not, and I was wondering if there was an efficient way of using, say, BreadthFirstScan[] and FindShortestPath[] to count the number of paths between some ...
1
vote
1answer
151 views

How do I create a graph with randomly directed edges starting from a undirected graph?

I have an undirected graph $G$. How would I randomly assign directions to some fraction $p$ of the edges? How might I do this efficiently / quickly provided I have a large graph structure? For ...
0
votes
2answers
244 views

How to specify VertexCoordinates as geographic coordinates of cities?

I have been very busy these days with giving the VertexCoordinates of the cities the geographic coordinates from ...
1
vote
1answer
107 views

How to get a list of 3-connected graphs?

I'd like to use GraphData to get a list of graphs with vertex connectivity at least 3. I know GraphData["Nonplanar", 6] gives ...
2
votes
1answer
86 views

What is the best way to save a large graph object, allowing it to be reloaded quickly in a new kernel?

I generated a very large graph, too large to simply display and manipulate with copy/paste operations. How can I somehow save the graph to a file to allow it to be rapidly reloaded after I quit out ...
2
votes
1answer
114 views

double arrow in GraphPlot

Is it possible to combine two edges into one with a double arrow? For example: ...
7
votes
2answers
96 views

How can I recover a graph from a graphical output in a notebook after resetting the kernel?

I have an old Mathematica notebook with an output for a graph structure $G$ I would like to recover. However, the routine for building up the graph is stochastic, so I can't simply rerun the code. ...
7
votes
1answer
209 views

Making FindShortestPath a little bit sloppy [duplicate]

I have a dense graph, and I'd like to find multiple "almost shortest" paths from a source vertex, $v_s$, to a sink vertex, $v_s$, on an undirected graph $G$. How can I repeatedly run ...
5
votes
2answers
261 views

Is there something akin to “SubgraphIsomorphismQ” in Mathematica 9?

Provided two unlabeled graphs, $G$ and $H$, I would like to test where $H$ is a subgraph of $G$. In other words, I'd like to test whether we can prune some fixed number of vertices or edges from $G$ ...
11
votes
1answer
287 views

Dynamic visualization of Graph[] on a webpage

How can we embed a dynamic version of a Graph object on a web page, similar to the one showcased on the networkx home page? This sort of dynamic visualization can ...
5
votes
2answers
208 views

Graph does not evaluate some options when not displayed

How can I force Graph to evaluate all its options without actually displaying the graph itself? Evaluating the following code ignores the ...
1
vote
1answer
155 views

Weighted Kirchhoff Matrix?

I have a weighted graph and I want its graph Laplacian matrix (what Mathematica calls the Kirchhoff matrix in the unweighted case). Is there an easy way to get this? For example, the command: ...
2
votes
1answer
111 views

Is it possible for me to explicitly specify a point list for SpatialGraphDistribution?

The function RandomGraph[SpatialGraphDistribution[n, r]] generates a random geometric graph over $[0,1]^2$ where vertices are connected if they are within a ...
2
votes
1answer
112 views

Determining whether two k-chromatic graphs are equivalent (not simply isomorphic) using IsomorphicGraphQ?

In a previous question of mine, I asked whether Mathematica's built-in routines could determine an isomorphism for two $k$-chromatic graphs, Determining whether two $k$-chromatic graphs are isomorphic ...
9
votes
2answers
231 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
2answers
326 views

Create a planar graph from a set of random points

A planar graph is a graph embedded in the plane in such a way that the edges intersect at vertices. This is an example of a planar graph: g = GridGraph[{3, 3}] ...
0
votes
1answer
87 views

How does SocialMediaData determine vertex size

How does SocialMediaData determine the size of graph vertices, e.g. on what does the vertex size depend in, say, a Facebook friend network graph?
4
votes
2answers
146 views

HighlightGraph with style

In this picture you see a graph. The shortest path between vertex 5 and vertex 3 is highlighted in red. Instead I want blue highlighted edges of thickness 10. ...
6
votes
1answer
120 views

Tooltip not working in web deployed cdf

I deployed a CDF file in a web page. I used both Mouseover and Tooltip functions. They both work in the raw CDF file. The ...
1
vote
2answers
343 views

How do I divide the columns of a matrix by the sum of its elements?

I am trying to create a transition matrix for a network. In order to do this, I need to sum down the column (the out degree), and then divide the column by the out degree in order to normalize it. ...
5
votes
2answers
181 views

Is there something wrong with VertexConnectivity

As I noticed in the documentation VertexConnectivity is defined as the following The vertex connectivity of a graph $g$ is the smallest number of vertices whose ...
3
votes
1answer
933 views

How can I draw the transition diagram of a Markov chain?

I apologize for my heaviness as I am a Mathematica novice. Is there a kind soul who can tell me how to draw diagrams like those shown on page 158, 160 and 161 of this document.Chaine de Markov I ...
3
votes
1answer
338 views

Adjacency List representation of a graph

I am looking to draw a graph knowing a simple adjacency representation of the graph like: A = {{1, 3}, {2, 3}, {3, 4, 5}, {4, 5}, {5}} Where ...
5
votes
3answers
871 views

Travelling salesman with start and end points for 30 points

I am doing a route optimisation for delivery vehicles and failing dismally. Please see problem statement below. My current solution uses FindShortestTour, but this does not have defined start and end ...
0
votes
0answers
97 views

Extracting Facebook Managed accounts (pages) in Mathematica? [duplicate]

I want to use Mathematica to explore various relationships on my Facebook pages. I've been able to successfully extract information on my personal Facebook page using the build in Social Media ...
0
votes
1answer
70 views

combining NeighborhoodGraph and RandomGraph

I have Combinatorica` and GraphUtilities` loaded in version 9 of Mathematica. If I then set: ...
3
votes
2answers
94 views

CommunityGraphPlot doesn't size

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 resized with ImageSize option. However that ...
5
votes
3answers
238 views

Export Graph to PDF

I know that I exported Graphs to PDFs before but it doesn't seem to work any more. I tried K5 = GraphData[{"Complete", 5}] Export["K5.PDF", K5] And I get a PDF ...
3
votes
2answers
138 views

The same value of VertexSize for vertices in different graphs causes different vertices size

I generated some graphs. The smallest vertices in the 1st graph should be the same size as the smallest vertices in the second graph. The smallest vertices have the same size (...