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
3answers
524 views

Fast code to generate large random graph with fixed degree sequence

I'm trying to create a function so to generate large random graph with a fixed degree sequence $\{v_1,v_2,\dots,v_N\}$, where $N$ is the number of vertices in the graph. The Mathematica function that ...
5
votes
1answer
598 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 ...
5
votes
2answers
398 views

How to add new nodes to an existing graph with fixed (coordinates) nodes?

I'm ultimately trying to create a directed graph with some of the nodes in fixed positions and the other nodes placed around them in "acceptable" positions. It's better if I ask the question by ...
5
votes
2answers
203 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 ...
5
votes
2answers
229 views

Graph does not evaluate some options when not displayed

How can I force Graph to evaluate all its options without actually displaying the graph itself? Evaluating the following code ignores the ...
5
votes
1answer
393 views

Accessing the graph Thinning produces without losing all the edges' lengths/slopes

This is a follow up to the OCR question I had earlier. What I want to do is to use Thinning to create "skeletons" of images of characters and then compare their shapes, utilizing such properties ...
5
votes
1answer
624 views

Analysis of Facebook group

I am the admin of a Facebook group for our year at university and wanted to graph the members of the group like you can with your own friends so we can find the isolated people and get rid of them (as ...
5
votes
1answer
1k views

When do I use Mathematica, when do I use Gephi, and how do I use them together?

Mathematica has great operations for analyzing graphs but when the graphs are a bit bigger, Gephi seems to be more efficient (at least on my computer) at drawing and analyzing, i.e. visualizing the ...
5
votes
1answer
73 views

How to use DegreeGraphDistribution with directed graphs?

DegreeGraphDistribution supports directed graphs because it has a DirectedEdges option. How can I specify the in-degree ...
5
votes
1answer
71 views
5
votes
1answer
204 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: ...
5
votes
1answer
236 views

Processing and storing a graph with a large number of vertices s.t. k-hop neighborhoods are efficiently retrievable

I have an unweighted, undirected graph $G$ with $(v_1, ..., v_N) \in V$ vertices, where each vertex in the lattice represents a string of some length ($\leq 200$ characters), and I need to construct ...
5
votes
1answer
501 views

(Efficiently) Generating graphs with vertex degree 3 for all vertices

I'm working on a graph theory problem, and given $n$ vertices, I would like to be able to generate all non-isomorphic connected graphs (not necessarily simple) with $n$ vertices, each having degree 3. ...
5
votes
1answer
250 views

Implementing local complements of graphs

I'm trying to write a routine which generates the local complement of a graph at a vertex. For those who don't know, the local complement for a singly-connected, undirected graph is defined as the ...
5
votes
1answer
155 views

Why do vertex labels disappear when I edit with drawing tools?

I'm trying to change the text and arrow style in GraphPlot using the drawing tool, but the the vertex labels disappear when I do that: ...
5
votes
1answer
242 views

How do I find a weighted bipartite graph's minimum edge cover using Mathematica 8?

In graph theory, we use the Hungarian Algorithm to compute a weighted bipartite graph's minimum edge cover (a set of edges that is incident to every vertices, the one with the minimum total weight.) ...
5
votes
0answers
55 views

Graph: PropertyValue changes and Dynamic

I almost never work with Graph in Mathematica but lately I helped someone with it. For this, I tried to make an animation using ...
5
votes
0answers
115 views

How to draw block diagrams as Graph objects?

In the documentation ClosedLoopResponsesWithAPIDController, There is a very nice block diagram. I want to create my own block diagrams similar to this. I clicked on the diagram and pressed ...
5
votes
0answers
71 views

Graph relationships between functions and variables [duplicate]

Possible Duplicate: Has anyone written any function to automatically build a dependency graph of an arbitrary Mathematica function? I need to make sense out of a huge notebook (17Kloc) ...
4
votes
2answers
223 views

Coordinate extraction and manipulating graphs as graphics objects

Consider the image below: GraphData[{"Wheel", 7}] Is it possible in Mathematica to lay several of these Graph along each ...
4
votes
3answers
491 views

How to create a planar graph from a set of random points

Question Given a set of points in the plane, how can you create a planar graph in the standard graph representation of Mathematica (version 9 or higher), from these points? Background A planar ...
4
votes
3answers
690 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: ...
4
votes
2answers
180 views

Visualize difference between members of the list

I want to visualize the difference between members of a set: set = {20, 36, 70, 96, 152, 301} This way I get the diffs: ...
4
votes
4answers
509 views

Graph Creation in Mathematica: TSP

I'm trying to create the following graph in Mathematica Where do I start? I'm specifically trying to make a graph so that I can use it in TravelingSalesman[g], ...
4
votes
2answers
72 views

Equivalent of RadialOutside for Graph VertexLabels

I'm creating a circular graph and want the labels to be placed on the outside of the vertices in a circular manner on the outside of the graph. I've been playing around with the ...
4
votes
1answer
1k views

How can I draw the transition diagram of a Markov chain?

I apologize for my heaviness as I am a Mathematica novice. Is there a kind soul who can tell me how to draw diagrams like those shown on page 158, 160 and 161 of this document.Chaine de Markov I ...
4
votes
2answers
274 views

Efficiently determining the largest minimum cost to travel from a fixed source to an arbitrary sink in a weighted graph

Let $v_i$ be a vertex in a graph $G$ with vertices $(v_1,...,v_N) \in V$ and edges $(e_1,...,e_M) \in E$ with associated weights $(w_1,...,w_M)$. Let $v_s \in V$ be specified vertex in the graph. In ...
4
votes
3answers
551 views

Graph generation given number of edges and nodes

I was wondering if it is possible to have Mathematica generate all graphs with a given number of edges and nodes (and possibly restricting the adjacencies) and draw them I know that there are some ...
4
votes
3answers
835 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 ...
4
votes
2answers
171 views

HighlightGraph with style

In this picture you see a graph. The shortest path between vertex 5 and vertex 3 is highlighted in red. Instead I want blue highlighted edges of thickness 10. ...
4
votes
2answers
2k views

How do I plot a solution of a differential equation?

I am having trouble generating a plot for a solution to my differential equations. I always end up with just blank axes. ...
4
votes
2answers
218 views

Odd behavior of GridGraph and DirectedEdges

For some reason the option DirectedEdges->True, albeit working internally with grid graph, does not appear in the visualisation for 1D and 2D graphs. It also ...
4
votes
1answer
118 views

How to impose control over vertex-to-vertex Graph edges?

I’m working on a Markov Chain and hope there is a way to impose control over how Mathematica places edges to connect vertices in a Graph. My Markov Chain currently consists of 4 vertices with 2 of the ...
4
votes
2answers
120 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
2answers
898 views

Finding face vertices from the face adjacency graph

I have a question about face adjacency graphs. Suppose that I have an adjacency matrix ...
4
votes
1answer
386 views

Get the neighboring vertices and incident edges from a vertex in a graph

I need to get the neighboring vertices and incident edges from a vertex in a graph. I assume NeighborhoodVertices can be used for the former. Anything better? Or ...
4
votes
3answers
603 views

Place graph vertex labels in circles

Consider the following code: ...
4
votes
1answer
111 views

The algorithm of ListGraphs[n,m]

I'm not sure if this is a Mathematica problem, math problem or a CS problem, so if this is off-topic please transfer it. In the package Combinatorica there is a ...
4
votes
2answers
134 views

TreePlot, VertexRenderingFunction and stretched vertices issue

Recently I found the following TreePlot issue. For simplicity, I took an example from Mathematica Tree Drawing Tutorial and set ...
4
votes
1answer
127 views

Why can't I export graphs with loops in V10?

I don't understand why the following does not work: ...
4
votes
1answer
133 views

Undocumented overload for Graph?

I stumbled (here, in the expression for the block diagram) upon a version of Graph that I don't see in the documentation over here. That documentation admits three overloads (the following are in my ...
4
votes
1answer
123 views

Agglomerate output to Graph

I'm using the HierarchicalClustering package to cluster some data. So let's say I have this: ...
4
votes
1answer
214 views

How do I make the color of arrowheads in a graph different from the colors of the arrows?

I'm graphing a Markov process mp = DiscreteMarkovProcess[{1, 0, 0}, ({ {0.6, 0.1, 0.3}, {0.2, 0.7, 0.1}, {0.3, 0.3, 0.4} })]; and would like ...
4
votes
1answer
190 views

Katz Centrality [closed]

I want to calculate the Katz Centrality of large graphs. The Mathematica command to do that is KatzCentrality[g, $\alpha$] and it is also fast. However I realized that there is a mismatch between ...
4
votes
1answer
154 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 ...
4
votes
2answers
169 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
2answers
130 views

LayeredGraphPlot: two instances of the same label

What I'd like to do is to have the same label more than once in the plot. I.e. I do not want the edges to direct toward the first instance of that label! For example: ...
4
votes
1answer
770 views

Creating a weighted, directed graph from ordered triples

I have a relatively large set of data that I am trying to turn into a weighted, directed graph. The data concerns the inflow of migrants based on country of origin. I currently have three columns of ...
4
votes
1answer
219 views

Counting the size of the minimum cut produced by MinCut of GraphUtilities`

I want to use the MinCut function of the GraphUtilities` package to find minimum cuts for a few graphs. I'm completely new to ...
4
votes
1answer
170 views

HITS centrality

I want the centrality measure of a particular vertex in my graph, and for Closeness, Betweenness and Degree centralities I have been using : ...