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)

2
votes
1answer
193 views

GridGraph layout with added edges

I noticed that the nice symmetric layout of a grid graph gets distorted when additional edges are added to the graph. Is there way to prevent that from happening and to keep the rectangular, grid-like ...
2
votes
1answer
318 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 ...
2
votes
3answers
425 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
3answers
446 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 ...
2
votes
2answers
313 views

Working around behaviour of EdgeRenderingFunction

One can make graphs GraphPlot[{1 -> 2, 2 -> 3, 3 -> 4, 4 -> 5, 5 -> 1, 1 -> 1, 5 -> 5}] and one can generalize the input such that one ...
2
votes
2answers
181 views

VertexLabelStyle not found in Mathematica 8.0.0.0

I tried to use VertexLabelStyle, but seemed not recognized in my system with version number 8.0.0.0. Is this expected or I have missed something? From the online ...
2
votes
1answer
47 views

MinimumVertexColoring does not work

g=RandomGraph[{5,6}] MinimumVertexColoring[g] I am using MacOS and Wolfram Mathematica 10.4
2
votes
1answer
41 views

Certainty of the New Vertex Name after using EdgeContract

It appears that when I use EdgeContract on an undirected graph, the vertex that is the result of contracting an edge is always named the smaller of the two vertices....
2
votes
1answer
59 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 ...
2
votes
1answer
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 ...
2
votes
1answer
89 views

DeleteVertex in Kpartite graph

How can i make K7,2 graph and how can i delete 2 vertex? Btw, i need to use package -> Combinatorica`; I tried this: ...
2
votes
1answer
64 views

Logic behind Graph[edges, VertexLabels -> “Name”]?

I find VertexLabels -> "Name" a strange setting to achieve graph nodes labeled by their index: ...
2
votes
1answer
80 views

`TransitiveClosureGraph` doesn't return self-loops for nodes that are in a cycle

This is from boost library documentation: The transitive closure of a graph G = (V,E) is a graph G* = (V,E*) such that E* contains an edge (u,v) if and only if G contains a path (of at least ...
2
votes
1answer
90 views

Export and Import a list of graphs?

I want to export a list of graphs that come as output to my program. However, I tried exporting all the graphs as graphs using Map and an Export statement with "graph.gml" statement, but got an error. ...
2
votes
1answer
344 views

LayeredGraphPlot Vertex Spacing / Edge Length

For anyone who has used LayeredGraphPlot (Mma v9), you have probably seen that the vertex spacing is consistent throughout, that vertices have the same minimum unit ...
2
votes
1answer
76 views

Finding if a graph contains an even cycle

I am looking for a simple boolean-like function which could check if a graph contains an even cycle. I'm aware there is ExtractCycles but I'm looking for a true/false output than a list of cycles.
2
votes
1answer
173 views

(Tree) Graph Layout

I am trying to draw a graph in a tree-like form. I can't use TreeGraph because what I am drawing is not properly a tree (has loops) so TreeGraph won't draw it. Here is the code: ...
2
votes
1answer
108 views

Overlapping EdgeLabels

I have to make a directed graph for a maximum flow algorithm assignment. Although I have managed to make the graph for the better part, it still needs some work. The problem is that Mathematica ...
2
votes
1answer
78 views

How to invoke default VertexShapeFunction and EdgeShapeFunction from custom ones?

For this question, g is a Graph object (of order ~2K) such that the VertexWeight and ...
2
votes
1answer
235 views

Creating an Adjacency Matrix to connect an undirected network

I used the locator pane to map a network, specifically the Maryland Power Grid. What I would like is to have some sort of numbering of the vertices on the unconnected network, how to make an adjacency ...
2
votes
1answer
171 views

Fix the size of vertices and arrow in graphs

I defined an option to draw nicely the graph. But I have a problem with the different size obtained. For example, the layout of the first graph is what I want to have for all other graphs I will ...
2
votes
1answer
145 views

distance between each vertex of a graph and its output

I have a question regarding this Q&A. Let's call a vertex that is not the tail of any directed edge an output of the graph. The graph below has only one output (at the far right). If I want the ...
2
votes
1answer
195 views

Arranging “ranked” nodes of a graph symmetrically

I have Markov chains with a pair of absorbing states taken from the $n$-length strings formed from {"H","T"} for n at least 3 (...
2
votes
1answer
63 views

Check Specific Connections within Graph

Say you have the skeleton of a graph: nodeset= PolyhedronData["Icosahedron", "SkeletonRules"] and you've an arbitrary list of some fraction of those nodes, say <...
2
votes
2answers
110 views

Checking connectedness of a graph

I am trying to use the Combinatorica package in a Mathematica version 8 in the following code: ...
2
votes
1answer
284 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 ...
2
votes
2answers
533 views

EdgeRenderingFunction question

Bug introduced in 9.0 and fixed in 10.0.0 (Edit 1 : I added this paragraph after the original post, for context) Some context for this question can be found in another post (http://mathematica....
2
votes
3answers
223 views

Graph with $\{a,b\}$ as Vertex Instead of Number

I'm trying to create a graph which has $\{a,b\}$ as labels: ...
2
votes
1answer
1k views

Adding an image background to a graph that uses vertexposition

Hello Mathematica stackexchange community! I need your help on a research project. I'm looking to create a graph g with vertices in specifies places and then use an image I have as the background of ...
2
votes
1answer
160 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
2answers
186 views

Most efficient way to output a cycle starting from an unordered list of graph vertices

I have some graph $G$ and a list of vertices $(v_1, ..., v_N) \in V$. Using graph structures in Mathematica version 9.0, what is the most efficient way to determine whether or not $(v_1, ..., v_N)$ ...
2
votes
2answers
497 views

Edges and crossing

I want to make a program where I have a collection of labeled vertices and edges between the vertices such that they join up with edges $a_{1} a_{2}, \; a_{2} a_{3}, \ldots ,\; a_{n} a_{1}$, so the ...
2
votes
1answer
302 views

Speed up iterated manipulations of a graph / table

I am trying to generate a version of Watts' model of cascading shocks to a network following the discussion on p. 20-25 of this article. The basic premise is to use the ...
2
votes
1answer
56 views

Network Analysis Problems with SystemModeler

Is it possible to analyse network problems like shortest path, minimum spanning tree, maximum flow, travelling salesman etc. with SystemModeler? If so where cm I find tutorials and examples?
2
votes
1answer
71 views

How to enlarge a specific part of a graph using Plot Command? [duplicate]

How to enlarge the closed curves of any Graph and Show them in a separate Graph within the ...
2
votes
1answer
70 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 ...
2
votes
1answer
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 ...
2
votes
1answer
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: ...
2
votes
1answer
70 views

Count graphs with fixed number of vertices incluing isomorphisms [closed]

I'm trying to use the listgraph function in the Combinatorica package: Needs["Combinatorica`"] g = ListGraphs[5]; ShowGraph /@ g However, it only returns all the ...
2
votes
1answer
179 views

Community detection on weighted graphs?

The documentation says that FindGraphCommunities works with weighted graphs. I've been playing around with a complete graph with weighted edges, and FindGraphCommunities always returns a single ...
2
votes
1answer
195 views

Dynamic process on graph

I have a question, which I failed to find an answer to myself. I'm a casual user of Mathematica, but do have some knowledge about Dynamic module and other "Advanced" features. My problem is ...
2
votes
1answer
267 views

Want to label vertices of a graph and manually move them around

I would like to plot a graph in such a way that The vertices are labeled using labels that I've given them, rather than just their number, I can manually move the vertices around. In the code ...
2
votes
1answer
66 views

Reversibly abstracting a list of strings as a graph object where vertices represent strings and edge connect pairs of strings based on various tests

Imagine I provide you a list of arbitrary strings, say: Map[StringJoin, Tuples[{"0", "1", "2"}, 4]]. I'd like to abstract these strings as a graph object in ...
2
votes
1answer
710 views

Create a graph from KML file

I'm wondering how I can take a .KML (Keyhole Markup Language) file and convert/express it as a graph for use in Mathematica. Even just in general, is it possible to convert a KML file to a graph? I'm ...
2
votes
1answer
453 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: ...
2
votes
1answer
109 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 ...
2
votes
1answer
143 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
159 views

VertexList ordering of a simple graph

Given a simple graph like g=Graph[{b -> c, a -> b}] I would like to have f[g] resulting in ...
2
votes
1answer
339 views

Changing some stuff to Kruskal's Algorithm

I'm trying to modify this algorithm: http://demonstrations.wolfram.com/ConnectingTownsUsingKruskalsAlgorithm/ The thing is that I want to receive a Graph (declared outside, with all its vertex, edges ...
2
votes
0answers
55 views

How to make circuit-like diagrams [duplicate]

I was reading through a blog post and found some really nice graphs, and I was wondering how to generate similar ones with Mathematica: