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)

1
vote
1answer
59 views

Using FindGraphCommunities, write community membership for each vertex to CSV

I have a network that I've loaded into Mathematica, and I've used FindGraphCommunitites[network,Method->"Hierarchical"] to identify the communities in the ...
1
vote
1answer
91 views
3
votes
1answer
107 views

Expected graph distance in random graph

I am trying to use the functionality of Expectation and Probability for random graphs, in particular for percolation models. ...
3
votes
2answers
161 views

Positioning Vertices in a Graph

I made a graph that has a given number at each vertex: I want to place vertex 1 above vertex 2 if value of vertex 1 is larger than of vertex 2. And also, vertices with same value should be located ...
2
votes
1answer
67 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 ...
3
votes
2answers
127 views

How to get all leaves from a graph's specific node

Let's say I have this graph (The code to generate the graph is at the end) How can I extract all the leaves comming from, let's say "cluster3"?, i.e. {100, 92, 87, 89} I guess I have to first ...
0
votes
0answers
48 views

Graph plotting: specify layers for layered drawing

Mathematica can do layered graph drawing with LayeredGraphPlot or GraphLayout -> "LayeredEmbedding". Is it possible to ...
8
votes
3answers
382 views

Mathematica 10 Graph issue

fixed in 10.0.2 Please try to evaluate this code in Mathematica 10. ...
3
votes
0answers
139 views

Undirected Network and its Monte Carlo Simulation

So I have this array of points, in the form {x, {y,z}}, where x is the node number assigned when I used the locator pane to make a network, and y and z are its unitary coordinates. The graph is made ...
4
votes
1answer
128 views

Agglomerate output to Graph

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

Cellular Automata Neighborhood as Node connections

Can I use the CellularAutomation[] function where the neighborhood is defined by the connections between nodes? For example, if 1 -> 2, 1 -> 3, 1 -> 8, 1 ->1, then the neighborhood of node 1 is the ...
3
votes
0answers
45 views

Does anyone know the options for “HierarchicalEdgeBundling” in Mathematica?

I'm looking to reproduce the types of graph layout that are possible in D3 (http://bl.ocks.org/mbostock/7607999) in Mathematica. Since Mathematica doesn't explicitly support force directed edge ...
2
votes
4answers
216 views

How to plot a graph from it's incidence matrix?

I'm using Mathematica v9 and am trying to draw a graph by using it's incidence graph, but it won't draw it, which occurs an error "is not a valid incidence matrix.". But I've checked my matrix, and ...
3
votes
2answers
135 views

Harmonious graph labeling

Is it possible to harmoniously label a graph in Mathematica? I would like a function, that when given a graph, would return a harmonious labeling. If not, is there other software that can do it? A ...
3
votes
1answer
75 views

Hungarian Algorithm using BipartiteMatchingAndCover Function

I have a bipartite graph with two sets of vertices. ...
4
votes
1answer
120 views

How to construct a polyhedron from its vertex graph?

Consider the graph given by ...
6
votes
2answers
284 views

How to color edges of a graph which has multiple edges connecting certain vertices

I'm studying BIBD(Balanced Incomplete Block Design) and want to draw some graphs by coloring their blocks in different colors, respectively. A block is a collection of edges (or vertices). For ...
2
votes
3answers
272 views

How to draw a combinatorial graph with different colors of edges?

For example, like above. I've read some examples and descriptions in here, but couldn't figured it out.
3
votes
1answer
49 views

Make AdjacencyGraph hide single unconnected elements

Is there a way to force AdjacencyGraph to hide single unconnected or self connected elements? ...
9
votes
1answer
237 views

Dual graph of an arbitrary (planar) graph

Every planar graph has a dual. How can I obtain it with Mathematica? I know that GraphData provides the DualGraph property for ...
0
votes
1answer
121 views

Generate Random 3D Network using GraphPlot3D and loop

Instead of writing all this out I want to do the same thing with a loop and be able to manipulate n and k. The idea is to create a randomly generated network where n is the number of nodes and k is ...
0
votes
1answer
178 views

Creating a Network from a Output

So I used the locator pane to derive the positions of a vertex on a picture. The picture was the Maryland Power Grid and the vertices were the generators and loads of the power system. When I clicked ...
5
votes
3answers
182 views

Converting expressions to “edges” for use in TreePlot, Graph

This question is similar to this: Nested list to graph. How to "flatten" an arbitrary expression, eg expr = a[b[c, d[e][f], g], h] to a list of key-value pairs ...
2
votes
4answers
365 views

How to find a path that traverses each edge of a graph exactly twice?

I have a question regarding a graph traversal problem. This is the graph I am working with: ...
1
vote
2answers
88 views

How can I speed up the export of graphs in DIMACS format?

I'm creating random graphs with suitable properties and exporting them in the DIMACS format. Already, for rather small graphs with, say, ~60k vertices and ~240k edges, ...
4
votes
2answers
112 views

How to obtain all the distinct De Bruijn sequences?

In combinatorial mathematics, a $k$-ary De Bruijn sequence $B(k, n)$ of order $n$ is a cyclic sequence of a given alphabet $A$ with size $k$ for which every possible subsequence of length $n$ in $A$ ...
6
votes
2answers
137 views

Why the Mouse dragging response not as smooth as Locator

I am experimenting to use MouseDragged eventhandler to change the vertices positions of a triangle, it works, but not as smooth as using Locators. Is this the ...
4
votes
1answer
113 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 ...
3
votes
2answers
120 views

Vertex Names of Subgraph in Order of Connectivity

I extract path subgraphs $P_4$ of an undirected graph $G$. And want to list the VertexNames of the subgraphs in the same order as they are connected. Here is an example: ...
30
votes
8answers
2k views

Longest path in 0/1 matrix

I have a matrix of 0's and 1's forming a number of disjoint paths:   I would like to find the lengths of the paths, and from that "spectrum," the longest length (in the above example: 27, ...
3
votes
1answer
259 views

Map of all graphs obtainable with GraphData?

I've been trying to put together an answer to another question, but I am stuck, so I decided to post this question instead. Mathematica contains (among its curated data) information on definition, ...
0
votes
0answers
33 views

Find set of subgraphs of g1 isomorphic to g2 [duplicate]

I would like to find all the subgraphs of a given graph g that are isomorphic to the graph h. My current code doesn't work how it should. Many solutions are missed and I think something is ...
3
votes
1answer
159 views

How to generate a random binary tree with a given number of vertices and with a given shape, namely compact or elongated

I tried to generate a random binary tree with a Table of RandomInteger and to give a shape with a ...
2
votes
3answers
161 views

Sequence of binary trees with different source nodes and with the same Strahler hierarchical order

I would like to create a picture which contains a sequence of binary trees with the same Strahler hierarchical order (for example equal to 2) e with a sequence of different source nodes "i" (from 1 to ...
0
votes
0answers
54 views

how to rewire the minimum number of edges in a disconnected bipartite graph, so to transform it in a connected one

Consider an incidence matrix A for a bipartite graph (Aij=1 if node i of group 1 and node j of group 2 are connected). A is not symmetric. Assume that A is disconnected or only weakly connected, i.e. ...
1
vote
1answer
85 views

Rendering of a HighlightGraph in a Manipulate content pane distorted by changing the highlighted edge

A HighlightGraph inside a Manipulate initially displays correct however after approximately 2 seconds, the layout changes and ...
3
votes
2answers
119 views

Labeling vertices by number in Graph: Getting text to display at the right size

Minor aesthetic question here. I was playing around with Graph's and decided to render a cute-looking family of directed graphs, with the vertices being the number ...
1
vote
2answers
75 views

Using Combinatorica`ListNecklaces in v9

I am using Mathematica for visualization of DeBruijn graphs. However, I am having a bit of trouble using ListNecklaces. I want to know how many cyclic shifts of ...
3
votes
0answers
171 views

Understanding performance: graph connected components

I need to analyze directed graphs with 10M edges, 1M vertices, and 300K strongly connected components, so that the largest one contains 400K vertices. I read some explanations of Leonid Shifrin here, ...
0
votes
0answers
94 views

Centrality measures and normalisation

Are centrality measures normalised in Mathematica 9? Only ClosenessCentrality is normalised. How I can normalise other centrality measures notably ...
2
votes
1answer
129 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 ...
1
vote
0answers
177 views

Triangular lattice with periodic boundary conditions

I am trying to generate an equilateral triangular lattice with fixed vertices and periodic boundary conditions. I am supposed to assign an index (starting from 0) to each vertex in my lattice and then ...
17
votes
5answers
565 views

Graph from binary matrix (not adjacency) respecting the original matrix positions

I have a binary matrix. My objective is to connect every close (without "jump") elements with value equal to 1, but I must keep the point positions, just like it's shown at the image. Can somebody ...
8
votes
2answers
337 views

Graphing a network with state transition flows (of varying size)

In one of Stephen Wolfram's recent blog posts (http://blog.stephenwolfram.com/2013/04/data-science-of-the-facebook-world/#more-5350) he provides the network plot below. The size of the arrows that ...
1
vote
0answers
56 views

GraphPlot not working properly

The code ...
3
votes
1answer
178 views

find cycle in directed graph

Given a digraph G in the form of a list of edges, is there implemented some command that returns a directed cycle in G of ...
14
votes
2answers
632 views

Animating transition between all graph representations obtained from curated data

Pappus graph is one of many graphs whose various data is contained within Mathematica. Mathematica typically keeps several ways of representing such graphs: ...
0
votes
1answer
65 views

How do I get a different (random) independent edge set each time I run FindIndependentEdgeSet?

I'd like to use FindIndependentEdgeSet[g] repeatedly to get random maximal matchings of a fixed graph, but each time I call this function it gives me the same answer (i.e. the same list of edges). ...
-1
votes
1answer
62 views

How to draw a network from a dataset reporting the labels of nodes of every link?

I have a dataset in format .txt of a directed network, containing a matrix A of dimension ...
5
votes
1answer
71 views