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

random geometric graph generation problem

I'm new to Mathematica. I'm trying to generate a random geometric graph in which to have a secure link between any two arbitrary nodes they should share a common key in their key rings (have assigned ...
3
votes
2answers
361 views

Manually adjust graph vertex location by dragging?

Sometimes I have a graph and I want to make tweaks to the vertex locations. Is there any way to manually adjust graph vertex location by dragging? If I double click to edit, I can move around the ...
1
vote
1answer
291 views

Vertex labels versus vertex names in VertexRenderingFunction

The VertexRenderingFunction seems to only use names, not labels. For example: ...
4
votes
2answers
195 views

GraphPlot with black edges no rendering function

Is there any way to make the edges of a GraphPlot black without tediously writing out a long "EdgeRenderingFunction"? I guess you could ask the same kind of question about vertex labeling. For ...
3
votes
2answers
179 views

How to apply GraphLayout to parts of a graph?

I'm trying to sketch polymers. Here is how I do it for the monomer: ...
3
votes
1answer
95 views

Is there really a bug in the following code, taken from the reference documentation for PetersenGraph?

PetersenGraph[5, 2, EdgeLabels -> {8 \[UndirectedEdge] 9 -> "hello"}] appears to evaluate perfectly, as expected, but in my version 9.0.1.0, the option ...
2
votes
1answer
218 views

Finding a Moore neighborhood connected path of bright pixels along the contour of a text character

I have a simple image, for example a blowup of a Times New Roman character like 'R' saved as a PNG. I then perform the following operations to extract a minimum representation of the contour lines ...
4
votes
1answer
194 views

Dijkstra without Combinatorica

There is some overlap between Combinatorica and the Graph related framework but there are also various elements missing. As far as I can see there is no 'Dijkstra' method or algorithm in Mathematica ...
0
votes
1answer
277 views

Mean path length of randomly generated graphs

I am looking to find the the average path length of 1000 random graphs with the following degree distribution, a few of the vertex degrees are included below ...
1
vote
0answers
71 views

GraphHighlightStyle with multiple datasets

I am trying to highlight several subgraphs of a graph using the following command: ...
6
votes
1answer
234 views

Shortest polygonal path

I'd like to find the shortest distance between some points (every point must be visited), such as between these 3 points: ...
1
vote
1answer
133 views

Connected components of a graph

I am trying to find the number of connected components of numerous named graphs within Combinatorica. The obvious answer seems to be: ...
2
votes
0answers
200 views

Tools for finding minimal or almost-minimal graph vertex colorations in Mathematica v9?

I'm looking to compute minimum vertex colorations (s.t. no two vertices of the same color share an edge: http://en.wikipedia.org/wiki/Graph_coloring) for graphs in Mathematica v9 with potentially up ...
3
votes
3answers
489 views

Generating a graph where vertices correspond to points in an integer lattice and edges connect points less than a threshold distance apart

I'd like to automatically generate a graph where vertices correspond to (and have the coordinates of) points in an $A \times B$ integer lattice, and a graph is generated by connected vertices within a ...
2
votes
0answers
55 views

How to use Automorphisms[] on a graph? [duplicate]

I am having difficulty mixing the new post-Combinatorica graph data structure, with functionality apparently only in Combinatorica. I have constructed a graph using ...
9
votes
1answer
135 views

How to get control over DepthFirstScan?

Is there a way to conditionally take control the flow during a depth-first scan against a TreeGraph? I have a tree graph whose nodes are constructed as object, and there's a method ...
2
votes
1answer
241 views

GraphPlot labels overlapping

If I plot the following graph with an EdgeRenderingFunction, the position of both the labels are at dead center, and with a large graph I have the labels completely ...
1
vote
2answers
495 views

Swapping elements of list

Say I have a directed graph inputted in the following format in Mathematica: g = {{1, "a", 2}, {2, "b", 1}} I'd like to plot this graph using ...
1
vote
1answer
179 views

Gradually coloring edges in terms of their vertices colors

In order to color Edges in a Graph after applying a function such as VertexDegree I did the ...
4
votes
2answers
159 views

BezierCurve in EdgeShapeFunction fails when used on multiedges graph

I would like to create a network graph with curved edges. To do this, I wrote this function: ...
4
votes
1answer
247 views

Compatibility issues for Combinatorica package

I am trying to use the Combinatorica package in a Mathematica version 9 in the following code : ...
6
votes
3answers
386 views

Flow in pipeline graph

I have pipeline directed graph which has one source and several sinks ...
8
votes
2answers
295 views

Organise a graph's vertices into levels

I would like to organise a graph's vertices in levels. Consider ...
3
votes
3answers
250 views

Product of edge weights in path

I need to calculate the product of graph edge weights on the path taking into account edge direction. I.e. for graph ...
6
votes
4answers
221 views

Draw graph wherein vertices are ArrayPlots

I need to place ArrayPlots in the vertices of graph. i.e. in graph Graph[{1->2, 2->3, 3->1}] I have to replace vertex 1 with ArrayPlots[{{0,0,1}}] and ...
5
votes
2answers
206 views

Total weight of a graph

I need to find the total weight of an WeightedAdjacencyGraph. I have a graph in that form ...
4
votes
3answers
1k views

Minimum spanning Tree from a weighted adjacency graph

Note: Cross-posted at http://community.wolfram.com/groups/-/m/t/137658?p_p_auth=8QnKtT9I I have a really big graph, 40x40. Here is my code ...
10
votes
3answers
698 views

Remove redundant dependencies from a directed acyclic graph

Given a directed acyclic graph, I want to remove all the edges $v_i \rightarrow v_j$ if $v_j$ is reachable from $v_i$ by some other path. Given the rich set of graph algorithms in Mathematica, what is ...
1
vote
1answer
147 views

Problem with GlobalClusteringCoefficient

I have a simple problem, I would like to measure the global clustering coefficient for a random graph. Here is my code: ...
1
vote
2answers
556 views

Coloring vertices using GraphPlot

I have the following problem: I used GraphPlot to plot my adjacency matrix. I divided my nodes in three groups: ...
3
votes
1answer
283 views

Merging Vertices of a Graph and adding up the edges weights

I have a Weighted Graph of g which looks like this. ...
0
votes
1answer
152 views

Testing Equality Expression?

Even if in Graph[{1 -> 2}] == Graph[{1 \[DirectedEdge] 2}] the answer is True ; but why MMA doesn't show the result of the ...
1
vote
3answers
195 views

Different Vertex Styling in a Graph

We can have this Graph: ...
2
votes
1answer
117 views

Distances of locations in the matrix form

I want to have the distances of the cities in the matrix form.How can I have it for example for the cities like followings that also includes the distance of the city from itself which is zero: ...
3
votes
0answers
286 views

How to compute the Lovász number for the given graph in Mathematica?

Here is a graph whose adjacency matrix is ...
0
votes
1answer
140 views

How can I replace UndirectedEdges to pairs of bi-directional DirectedEdge in a Graph?

How can I have pair of edges between nodes in this kind of graphs? ...
3
votes
1answer
324 views

Vertex Labeling Problem in a Graph

I am using following codes to create a graph. ...
16
votes
4answers
538 views

Can TreeForm be displayed “sideways”?

One recurrent problem I'm having with displays generated with TreeForm is that the expressions to be so displayed often at least one level with many (> 20) nodes ...
1
vote
1answer
95 views

Is there a TwoColoring function of Graph object?

The following code shows the GraphUtilities package makes a problem for Graph object. I want to use a ...
10
votes
1answer
756 views

Roads network visualization by thickness and color intensity by population from GIS files

We can have road networks of the countries in GIS shape file.For exmple from here. Normally traffic flows are proportionate to populations of the cities. I wonder how we can have the same in ...
5
votes
1answer
837 views

All possible topological orderings of a graph

TopologicalSort[] returns one of many unique orderings. From wikipedia: if a topological sort does not form a Hamiltonian path, the DAG will have two or ...
6
votes
1answer
83 views

Setting PropertyValue for VertexWeight is not persistent

g = CompleteGraph[8, VertexSize -> Medium]; PropertyValue[{g, VertexList[g][[1]]}, VertexWeight] = 10; PropertyValue[g, VertexWeight] ...
3
votes
1answer
61 views

Problems with PropertyValue when Graph's vertices are Lists

I create a Graph which vertices are lists (points in n-dimensional space) ...
2
votes
1answer
385 views

GraphPath: *all* shortest paths for 2 vertices, edge lengths negative

Mathematica uses Bellman-Ford to find a shortest path between two vertices when the edge lengths are negative: ...
3
votes
1answer
233 views

How can I highlight and individually color the connected components of a graph?

I have a graph G, and I wish to individually highlight and color the different connected components of a graph. It is simple enough to do this for one component: ...
1
vote
1answer
208 views

Do any users know of methods to capture Twitter feeds and subject them to analysis? [duplicate]

I would like to use the output of about 300 Twitter sources and would probably collect 30 minutes of tweets at a time and subject each collection to analysis; ideally this process would be automatic ...
1
vote
1answer
113 views

FindEdgeCut with weighted graphs

If I want to find a minimum cut between two nodes in a weighted graph, I would use FindEdgeCut as follows: ...
7
votes
1answer
447 views

Adding/deleting weighted edges to a weighted graph

How can I add and delete weighted edges in a weighted graph? Using Graph in Mathematica I want to add a weighted edge to a weighted graph. The problem is ...
3
votes
2answers
200 views

Separating disconnected graph objects without losing vertex coordinate assignments

Say I have a graph Gtest, which has multiple disconnected components. I found that I can isolate individual components while retaining vertex coordinate ...
9
votes
1answer
115 views

FindHamiltonianCycle is not invariant to edge permutation

Found this bug-like behaviour today: if the order of edges is changed so that VertexList does not return the vertices in canonical order, ...