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)

5
votes
1answer
89 views

Relaxation of Mass-Spring System with Pinned Masses

Problem Assume that four masses are connected to each other by springs while two of them are pinned down at their initial positions. Find the position of masses when system is at its minimum ...
2
votes
3answers
108 views

How can I get from a list of characters representing a permutation to graphics showing the cycles?

I am trying to graphically represent cycles in various permutations of the alphabet, and have a question in two parts. I have ...
1
vote
0answers
54 views

Better layout for large a directed graph?

This shows a directed graph for an iterated n-bit pseudo-random function parameterized by s. ...
7
votes
2answers
2k views

How to find the Shortest Path, visiting ALL vertices, without coming back to the start (Hamiltonian Path, minimum distance)

A car has to pick up each person and take them to their destination. I am trying to find the shortest tour that will do this. How can I find the shortest path between any s and t.... visiting all ...
0
votes
1answer
30 views

How to input an adjacency list?

I am a beginner user of Mathematica, and I have an assignment to construct a graph given n (number of vertices) and an adjacency list. My idea was to make a For cycle that repeats n times, and for ...
1
vote
0answers
31 views

Better control of vertex positions in GraphPlot?

I am trying to graphically visualize a sort of a transformation network. My program generates a list of vertices and edges and I want to turn that into a visually clear graph fulfilling a few ...
5
votes
1answer
86 views

Finding the minimum vertex cut of a graph

It seems that Mathematica is not correctly finding the smallest set of vertices that will disconnect a graph. Here is an example: ...
7
votes
2answers
257 views

Finding All Chordless Simple Cycles In A Graph

I am doing a research on networks which consists of polygons with different number of sides. I am trying to find all simple cycles in a network which are cordless. As an example, consider the ...
1
vote
1answer
69 views

Computing Domination Numbers of Graphs

Is there a way to get Mathematica to compute the domination number (size of the smallest dominating set) of a graph? There doesn't seem to be a direct command for this, so I'm not sure if there would ...
2
votes
0answers
34 views

Replicate CommunityGraphPlot as a Graph

Is it possible to format a Graph object in a similar way to CommunityGraphPlot, but retain it as a Graph? I've been playing with FindGraphCommunities but I'm obviously missing some of the ...
0
votes
0answers
21 views

How to make the vertices move with the VertexRenderingFunction graphics when clicking and dragging vertices of a layered graph [duplicate]

I have read the suggested similar question here: VertexRenderingFunction (or EdgeRenderingFunction) with movable nodes? and Mr. Wizard's solution. Please could someone help me to apply his method to ...
0
votes
1answer
46 views

Import GEXF graphs into Mathematica?

Is there any smart way to import gephi graphs (*.gexf) into mathematica ? I mean other than converting to *.gml.
3
votes
0answers
37 views

Undocumented options for “BalloonEmbedding” in GraphLayout

From an error message, I see some options of the BalloonEmbedding method for GraphLayout: ...
1
vote
1answer
41 views

Adding a title to TreePlot

This is a basic question I am sure, but cannot seem to find the answer in the documentation. Does anyone know how to add a title to a TreePlot?
1
vote
0answers
43 views

How to set the Y coordinates for a Graph with defined X coordinates to prevent overlap of nodes?

I would like to draw a Graph with defined x coordinates and variable node sizes. If I simply replace the x coordinates of a graph, then nodes can overlap and edges may cross each other. I would ...
1
vote
1answer
49 views

Find all perfect matchings of a Graph

I'm trying to find all perfect matchings for some bipartite graphs. For example ...
5
votes
1answer
278 views

How can I compute the chromatic index and number of a graph?

I saw a recent question from M.R. and realized there is no function to compute the chromatic index and number of a graph, other than a really slow method in the now deprecated Combinatorica. So, how ...
1
vote
1answer
96 views

Distinguishing left from right adjacent triangles in triangle mesh

What I'm trying to do: I'm trying to create a path-drawing function which will produce a path like the one I-P in the diagram below. The way this path was generated requires me to swap between the ...
1
vote
2answers
60 views
0
votes
0answers
35 views

Is it possible to visually edit a graph?

Given a graph, obtained by something like CompleteGraph[5], can I somehow add/remove edges/vertices visually? Or is the only alternative to transform it via ...
1
vote
2answers
44 views

How can I construct a random graph, which is created by adding orientation to a complete graph?

Given a complete graph on N vertices, how can I randomly orient all of its edges? I thought about starting out with CompleteGraph[n], and then somehow transforming ...
2
votes
2answers
186 views

Can I solve this graph theory problem with Mathematica?

Internet browsing I came across this problem, as can be solved using Mathematica. Edit: The image says: Place the following numbers 1,2,3,4,5,6,7 in the following diagram (all), without repeating any ...
1
vote
1answer
55 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. ...
1
vote
1answer
47 views

VertexLabels, EdgeLabels and the direction of the arrows on a directed graph

I want to have three network types. My plan is to put them together in a figure file via marking them with (a) (b) and (c). The figures that I want to have, have some problems. Here is my code ...
1
vote
1answer
50 views

Is there a way to combine VertexLabeling->True and VertexLabels/Tooltip in TreePlot?

Basically, I'm trying to make Mathematica give me a tree with names inside the rectangles like so: ...while also having the properties of VertexLabels or Tooltip, which lets me place my mouse over ...
10
votes
1answer
284 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
0answers
62 views

Draw mesh edge / map a graph to a mesh

I am doing a "force density" method to generate a mesh under certain load. The original mesh is like this: Then, I generate a IncidenceMatrix from the graph for further matrix transformation and ...
0
votes
2answers
103 views

Random geometrical graph generation

I would like to generate a random graph on $[0,1]^2$. Each node is connected to one other if the distance between two nodes is say 1/4 or less. Here is an example with 50 nodes and 200 edges I would ...
4
votes
1answer
419 views

Something interesting about Pi, but something seems amiss

I saw something interesting about text-analysis - bigrams - in Basic Text Analysis in Mathematica I wondered how the bigrams of Pi's digits might appear. As expected, take enough terms and every ...
0
votes
2answers
88 views

Normalize centrality measures

How I can normalise centrality measures? Can I use Normalize function? I give example of unnormalized measures ...
1
vote
0answers
27 views

Successive addition or deletion of vertices (or edges) in graph

I am trying to perform a kind of dynamic graph simulation where vertices and edges of graph are added and deleted according to the current state of the graph at each time step. I know that there are ...
4
votes
1answer
147 views

VertexRenderingFunction (or EdgeRenderingFunction) with movable nodes?

In GraphPlot, I'd like to use VertexRenderingFunction (VRF) and have the resulting object behave the same way under dragging verticies as it does when I do not use VRF. The same issue occurs for ...
0
votes
0answers
41 views

Trying to write a program to find an approximate harmonic function on a given graph using relation method

So given an undirected graph with two vertices that have fixed values assigned to them, a harmonic function is a function that assigns values to all other vertices such that the value assigned to each ...
0
votes
1answer
46 views

EdgeRenderingFunction For 2 Vertices in a Loop

Assume there is a set of rules: set = {"A" -> "B", "B" -> "A", "B" -> "C", "C" -> "D", "D" -> "A", "C" -> "C"}; which we want to graph using ...
1
vote
0answers
45 views

What do the default shapes/colors in DiscreteMarkovProcess Graph mean?

In making markov chains, I know how to do that, but I am curious as to what the different colors, and shapes of the vertexes in the graph output mean. as example; ...
2
votes
1answer
236 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
2answers
48 views

Efficiently or Elegantly construct linear graph list from vertex pairs

I am processing MRP data, with BOM relations as pairs of part number strings. I want to construct lists that represent the linear graphs defined by these pairs. Here is some code to generate random ...
1
vote
0answers
20 views

FindIndependentEdgeSet behaves differently in v9 and v10

The following code gets different output in v9 and v10. ...
5
votes
2answers
163 views

Drawing a path which realises the diameter of the graph

So I enter a (0,1) adjacency matrix and I get the following graph: The diameter of this graph is 4. How can I ask that two vertices which realise this diameter be drawn with different filling ...
7
votes
2answers
278 views

Is there a bug in FindClique?

If h is a graph, FindClique[g, {n}] should return a clique on exactly $n$ vertices if one exists in ...
2
votes
2answers
50 views

Color edges of a multigraph when there are parallel edges using Graph[] and EdgeStyle

This a related question to : How can I display a multigraph with different colored edges? However I'm not using GraphPlot. Instead I'm using Graph and EdgeStyle attribute. Take this graph : How can ...
4
votes
2answers
184 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 ...
1
vote
1answer
71 views

LayeredGraphPlot: how to specify edge endpoints?

What directive within the LayeredGraphPlot command specifies where the edges attach to vertices? For example, instead of the left output below, I'd like to have the right one. ...
6
votes
4answers
195 views

Automatically convert pairs of directed edges to an undirected edge?

I have a directed graph, which for some pairs of vertices, has a directed edge between them in each direction. I would like to replace such pairs of directed edges between the same vertices but in ...
0
votes
0answers
35 views

Error with AppendTo [duplicate]

I am trying to write a function that builds a graph, or - better said - adds a layer of leaves to a pre-existing graph. Basically, I hand to the function three lists. ...
0
votes
0answers
43 views

Draw a single disconnected vertex [duplicate]

I am just started using Mathematica. I am trying to split my graph into two sets. 1. How does Mathematica split the graph into 2 subgraphs (connected or disconnected)? 2. How can I draw a graph with ...
2
votes
1answer
45 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 ...
3
votes
2answers
128 views

Using GraphData to generate all directed graphs with n vertices

Using Combinatorica, it was possible to generate unlabeled (non-isomorphic) directed graphs of |V|=n. Here the example is for n=4 ...
24
votes
4answers
1k views

Finding a “not-shortest” path between two vertices

In designing a routine for making a simple three dimensional (5x5x5) labyrinth, I realized that my solutions (a solution is a labyrinth includes a single path from {1, 1, 1} to {5, 5, 5} in a 5 x5x5 ...