Questions about handling graphs in Mathematica, graph theory, graph visualization, GraphPlot, the built-in Graph type and the Combinatorica` package.
3
votes
0answers
34 views
Generating ALL spanning trees in an undirected graph
I was wondering if there is explicit source code for generating all spanning
Trees on undirected Graphs. I don’t need anything very
fancy – perhaps Minty's algorithm or Gabow&Myers. I've only ...
1
vote
1answer
63 views
Plotting a network or a graph with given coordinates for vertices
I'm new to Mathematica yet have coded a lot in MATLAB. Currently I'm working on a network simulation. My model is implemented in MATLAB, but I need to port it to Mathematica.
Here is my question:
...
6
votes
1answer
90 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 ...
-4
votes
0answers
35 views
Any given a complete graph, through the program calculates all of his non-isomorphic spanning subgraph [closed]
Any given a complete graph, through the program calculates all of his non-isomorphic spanning subgraph, ie write the complete figure can be calculated for all non-isomorphic subgraphs program just ...
7
votes
2answers
147 views
FindShortestTour for charity (or: How can I optimize meal delivery with FindShortestTour?)
I've been wondering about this for a while - but never got around to asking - until I saw faleichik's incredible answer to Mathematica Minecraft.
I did some work at a not-for-profit a little while ...
2
votes
1answer
65 views
PermuteSubgraph not working? (Combinatorica)
I am trying to write a code to perform the QAP partialling analysis (here's a paper to know more) but the part in which I "scramble" the graph with PermuteSubgraph does nothing, I am actually not ...
0
votes
0answers
41 views
Subset of edges with a different color
I want to color a subset of the edges of my graph with a different color.
My graph currently has a large number of edges, so the following is just a toy example
...
0
votes
2answers
38 views
Basic question on producing non-overlapping graph nodes in a graph
I am plotting a graph which has about 196 nodes.
...
1
vote
1answer
76 views
How do I change the Head of Graph into List?
I am trying to change the Head of b (a NeighborhoodGraph) from Graph into List but Apply seems to fail. I start with a list of connected vertices:
...
8
votes
1answer
157 views
How can I sequentially apply different graph embeddings?
Imagine I have some graph G, and I perform a graph embedding using a command like:
...
5
votes
0answers
64 views
Is there a function to generate a minimal clique cover?
This is a graph problem known as the "Clique Edge Cover" or "Intersection Number" problem, and the goal is to find, from a given graph like $E=\{\{a,b\},\{a,c\},\{b,c\},\{b,d\},\{c,d\}\}$ and ...
1
vote
1answer
67 views
How can I preserve the properties of edges of the original graph $g$ in a subgraph that doesn't include every edge of $g$?
The closest question to the following I could find was Preserving labels when using graph functions, but it doesn't seem to cover this.
Consider a graph g where ...
1
vote
1answer
209 views
I want to draw a graph using a weighted Adjacency matrix
I have a weighted adjacency matrix as follows:
...
1
vote
1answer
66 views
How can I get precisely the subgraph corresponding to a set of edges?
Consider the complete graph on 3 vertices.
Then, a method gives me a list of interesting edges, say $\{(1,2),(2,3)\}$. I want to get a subgraph of $g$ that corresponds to precisely the given ...
3
votes
1answer
95 views
How can I construct “better” block graphs?
A graph is a block graph if it can be constructed from an undirected tree by replacing each edge with a clique. My method of generating "random" block graphs is as follows. The parameters are the ...
6
votes
2answers
405 views
Finding all simple paths between two vertices in a graph
There are built-in methods to find a shortest path between two vertices in a graph, and the question on finding all shortest paths between two vertices has gathered quite a bit of attention.
A path ...
2
votes
1answer
236 views
GraphPlot only working when I evaluate twice
I have some code that builds a graph and some vertex coordinates, but when I evaluate it I get a message that the list of coordinates is not valid and the graph is not valid and it shows the output as ...
6
votes
2answers
229 views
1
vote
2answers
90 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:
...
7
votes
0answers
190 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 ...
8
votes
2answers
246 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
0answers
40 views
Unexpected error message from GraphPlot evaluation [closed]
(Running MMA 9 on Mac OSX 10.8.3, MacBook Pro, 16GB RAM)
I am trying to display a graph with GraphPlot. I want a few of the edges to be purple, and the rest red. I figured out a way to do this that I ...
2
votes
0answers
113 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
196 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
33 views
1
vote
1answer
82 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
141 views
4
votes
2answers
121 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
...
12
votes
1answer
177 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 ...
9
votes
2answers
170 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
1answer
151 views
Isomorphisms for graphs with loops and multiple edges
I am working with graphs with multiple edges and loops, and I want to eliminate all isomorphic graphs from a long list I've generated. The FindGraphIsomorphism ...
11
votes
2answers
199 views
Listing subgraphs of G isomorphic to SubG
If I have an undirected graph G, how could I write a function in Mathematica to obtain a list of subgraphs of G that are isomorphic to some other undirected graph SubG?
I'd like to learn how to ...
2
votes
3answers
233 views
How to find all graph isomorphisms in FindGraphIsomorphism
I found the second definition of the function FindGraphIsomorphism not working.
Here's the definition Mathematica 8 gives:
...
5
votes
2answers
207 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$ ...
5
votes
2answers
127 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 ...
1
vote
1answer
83 views
23
votes
1answer
411 views
Finding the likeliest path in a Markov process
With Mathematica 9, we have the addition of various processes, among which the discrete Markov process. Given a transition probability matrix m, such a process is ...
3
votes
0answers
84 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
68 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
65 views
What algorithm is Mathematica using for FirstPassageTimeDistribution[]?
What algorithm is Mathematica 9 using for FirstPassageTimeDistribution[]? Is it attempting to use PseudoInverse[] on the ...
2
votes
2answers
175 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}]
...
5
votes
3answers
419 views
Random Geometric Graphs
I'm trying to implement an application which uses random geometric graphs in Mathematica, but it seems Mathematica lacks the functionality. I need the following functionalities:
Generate a set of ...
0
votes
2answers
55 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
1answer
96 views
0
votes
2answers
102 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:
...
2
votes
3answers
103 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
67 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 ...
4
votes
0answers
91 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 ...
5
votes
3answers
125 views
1
vote
1answer
99 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 ...





