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
119 views

Efficiently find all connected subgraphs

Is there a way to generate all the connected subgraphs of a graph in mathematica without going through all the subsets of the nodes and checking if the subgraph is connected (which will be ...
2
votes
1answer
370 views

Display a labeled multigraph

Introduced in version 9, fixed in version 10. Thanks Szabolcs for providing this screenshot showing that the bug is fixed. Despite the integration of graphs and networks, multigraphs are ...
2
votes
1answer
172 views

Distinguishing left from right adjacent triangles in triangle mesh [closed]

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 ...
4
votes
1answer
46 views

Why does TreePlot ignore the vertex labels in a TreeGraph argument?

Example (watch the vertex labels): aTree = TreeGraph[{"a" -> "b", "a" -> "c"}, VertexLabels -> "Name"] ...
9
votes
2answers
227 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 ...
12
votes
2answers
965 views

Combinatorica package and graph-theoretical issues

I've searched for a solution to my problem a couple of days, and I didn't find one. Hope you guys can help me. I'm currently trying to solve some graph-theoretical problems. One of them is to find ...
15
votes
2answers
4k views

Solving the Travelling Salesman Problem

I've been trying to find some kind of mathematical computer software to solve the Travelling Salesman Problem. The Excel Solver is able to do it, but I've noticed there is a built-in function in ...
1
vote
1answer
65 views

Powerset Animation/Invisible Vertices/Graph Layout

I wanted to visualize the cumulative powerset construction process and came up with two functions: ...
8
votes
2answers
270 views

Creating a hyperlink graph from Wikipedia

This goes out to all the Mathematica experts - I'm hoping to get some helpful comments, ideas or code for that matter. In my attempts to maximize learning efficiency I had the idea to create an ...
8
votes
2answers
311 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 ...
9
votes
1answer
224 views

Possible improvements to this Syracuse (3x+1)/2 graph?

This algorithm produces the Syracuse disjoint tree graph without any duplicates. No need for Union, For, and ...
1
vote
0answers
31 views

Unexpected behaviors with Edge Weights

Noticed some bizarre behavior when subgraphing on weighted graphs, which probably extends to graphs with arbitrary edge properties. I construct a weighted graph with five edges, defining a specific ...
7
votes
0answers
181 views

How to generate a random flow graph?

A flow graph is a rooted directed graph that the root reaches all other vertices. I need to generate a random flow graph in Mathematica. My idea is to use ...
1
vote
1answer
231 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 ...
1
vote
2answers
50 views

Avoiding overlap in rendering of GraphPlot

I'm trying to visualize some 'graphs' (i.e. the mathematical objects with nodes and edges) using GraphPlot[]. I am defining the nodes using objects such as ...
8
votes
1answer
195 views
23
votes
1answer
580 views

How to visualize large graphs with directed edge bundling?

I'm wondering if anyone has implemented edge bundled graph plotting? An important paper is "Force-Directed Edge Bundling for Graph Visualization" by Danny Holten and Jarke J. van Wijk.
6
votes
1answer
72 views

Graph: Coloring Edges individually

CODE: Graph[{Style[0 -> 1, Red], Style[0 -> 1, {Blue, Dashed}]}] This mathematica code will make both lines solid Red, since they belong to the same two ...
5
votes
1answer
56 views

RandomGraph with specific constraints

I need to generate random connected simple graphs (no loops) with the constraint that exactly two vertices must only have a single edge. I can create many connected graphs (but very few will have the ...
0
votes
0answers
38 views

Create graph K5, delete 2 edges and 2 vertex, create adjacency matrix [duplicate]

I need help about this problem. I should create graph K5, delete 2 edges and 2 vertex from it and from the new graph create adjacency matrix. I have poor knowledge and i don't need anyone to solve the ...
2
votes
1answer
80 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
2answers
65 views

Graph not drawing after VertexDelete

I'm very new to Mathematica and am currently trying the VertexDelete function, but after using it, my graph isn't drawing. Input: ...
3
votes
1answer
71 views

How to use the edge routing of LayeredDigraphEmbedding when specifying explicit vertex coordinates?

The "LayeredDigraphEmbedding" GraphLayout uses an edge routing algorithm which produces nice and readable diagrams and curved ...
6
votes
3answers
209 views
3
votes
1answer
120 views

Can I make a simple game in Mathematica?

Here is the game outline: $\hspace{2.5cm}$ There is one player. The player ($\mathscr{L}$) moves from node to node limited by the directed arrows. As the player moves, $\mathscr{G}_{\Huge\cdot}$ ...
1
vote
0answers
104 views

Using NMinimize to solve the Multi Commodity Flow problem

I have the following optimization problem and I was hoping to solve it with NMinimize. Unfortunately, I don't get the desired result. I would like to get an optimal vector for $d_{e}$. This is how ...
-2
votes
1answer
52 views

FindShortestPath does not work

The FindShortestPath doesn't work in this graph, can someone tel me what's wrong? ...
2
votes
1answer
97 views

How do I get the adjacency Matrix from a random graph [closed]

I am using the command g = RandomGraph[{8, 13}]; GraphPlot[g, VertexLabeling -> True] to plot a random graph with n nodes and l edges. Once the program has ...
2
votes
1answer
58 views

Efficient Implementation of Resistance Distance for graphs?

Is there an implementation of the resistance distance matrix (or just resistance matrix) for graphs available in Mathematica?
1
vote
1answer
67 views

Constructing an I-graph

I am attempting to build I-graphs in MMA, i.e. the non-Generalized Petersen graphs, and I found some code from Eric Weisstein, but this is now outdated and doesn't run. I have attempted to switch the ...
3
votes
2answers
180 views

Test if directed graph is connected

Is there a simple built-in way to check if a directed graph is connected? Now, before you throw ConnectedGraphQ or ...
3
votes
0answers
149 views

How can I scrape the social network for a subset of users in Twitter?

Clearly one cannot scrawl the entire network... but I'd like to extract a statistically representative sample from the network. More specifically, I'd like to access the graph induced by scraping the ...
0
votes
1answer
125 views

Displaying a bipartite graph in Wolfram Mathematica

Which is the function that can plot me the bipartite graph $K_{7, 2}$ in Mathematica? And after that to delete 2 edges?? Thanks for the help.
4
votes
2answers
135 views

Limit FindMinimumCostFlow function to one vertex per path

I want find a set of paths through a graph that maximise flow and minimise cost set on each Edge. However, I have an additional constraint where each Vertex can only be visited once. Mathematica has ...
1
vote
2answers
92 views

Find all perfect matchings of a Graph

I'm trying to find all perfect matchings for some bipartite graphs. For example ...
4
votes
1answer
74 views
5
votes
2answers
104 views
8
votes
3answers
392 views

How to remove all dead ends from a undirected graph?

so what I want to do is take an undirected graph, and remove all the "dead ends" (that is, vertices that are attached to only one other vertex), but do it in such a way that it does it until reaches ...
0
votes
1answer
85 views

Cannot find a way to display an adjacency matrix [closed]

I have a question about face adjacency graphs. Suppose that I have an adjacency matrix How can I plot something like this?? I tried and it looks too messy. What may be the resulting graphic? Thank ...
1
vote
1answer
50 views

Graph Edit Distance with Mathematica?

Is there any way to calculate similarity of graphs or the graph edit distance in Mathematica ?
2
votes
0answers
38 views

Custom graph distribution

I am working with random graphs a lot. It's quite easy to describe random graph using, adjacency matrix or just a list of edges. However I am thinking that I might benefit from describing random ...
1
vote
1answer
65 views

Finding adjacency matrix of a Mathematica's in-built graph? [closed]

I want to get the adjacency matrix of an in-built graph, say the dodecahedral graph. Naively using AdjacencyMatrix[Dodecahedral] doesn't give it to me. Any ...
1
vote
0answers
30 views

ConnectedComponents problem of syntactic structure

In Mathematica 10, ConnectedComponent computes the list of vertices belonging to strongly connected components. In the following simple example with a graph with no edges, the result is as follows: ...
1
vote
0answers
65 views

Twilight Zelda Guardian Puzzle : Shortest Path Proof [closed]

I'm playing a video game right now and in it is a puzzle (see here). There are solutions to solving it (see here) on the Internet, but I'd like to know if this path is the shortest path (least amount ...
2
votes
1answer
45 views

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

I find VertexLabels -> "Name" a strange setting to achieve graph nodes labeled by their index: ...
9
votes
4answers
274 views

Multiple Forms of Transportation Between Cities

I want to be able to show different connections between cities based on modes of transportation. For instance, you could walk to any city, but it would take a long time, you could take a train, but ...
1
vote
0answers
28 views

DataRange not working in GraphPlot

I am trying to create a a GUI that uses the GraphPlot function to automatically generate graph vertices. I am using the VertexCoordinateRules option to designate that I want some of the vertices to be ...
7
votes
1answer
208 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 ...