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)

14
votes
2answers
765 views

Drawing pairs (graph, circle packing)

Circle packing theorem states: For every connected simple planar graph G there is a circle packing in the plane whose intersection graph is (isomorphic to) G. How to use Mathematica to draw examples ...
-1
votes
2answers
200 views

Plot “number of triples at each v in V(G)” [closed]

For a uni assignment, I need to plot the "number of triples at each v in V(G)". I tried to find relevant information in the Mathematica documentation through Google, but I'm lost. How do I get the set ...
2
votes
1answer
78 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
145 views

Plotting attributes of vertices in WattsStrogatzGraphDistribution[n, p, k]

I have a graph WS = RandomGraph[WattsStrogatzGraphDistribution[n, p, k]]. I need to plot several characteristics of each v: the ...
2
votes
1answer
96 views

How to compute the `Automorphisms` of graphs with multiple edges?

I try to compute the Automorphisms of graphs with multiple edges from its AdjacencyMatrix but failed. The following code shows ...
0
votes
1answer
52 views

How should my data be formatted for use with BetweennessCentrality?

A few weeks ago I asked this question. I am trying to upload my data which is an adjacency list for an undirected, unweighed graph and find the betweenness centrality. At the time I tried to use the ...
4
votes
1answer
142 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 ...
1
vote
1answer
96 views

How do I show the transition probabilities in a graph of a Markov process?

How do I get Graph to display the transition probabilities for a Markov process as labels on the graph's edges? The information is clearly present in the graph, but ...
1
vote
1answer
56 views

What does the VertexMoving method for FindGraphCommunities do?

I've been applying the VertexMoving method to some graph data, and it's producing very useful results. However, I've got no clue as to what this method actually is, and the documentation is ...
0
votes
1answer
129 views

Get histogram of number of vertices per component of graph H

I have a huge graph with ~8k vertices and ~1k components. I want a histogram showing the number of vertices for each component. How do I do this? EDIT: I'm trying ubpdqn's approach, but not gettting ...
0
votes
2answers
129 views

How to find number of connected components of graph G?

Is there a command that can count the number of components of a graph, in the same way that VertexCount[G] counts vertices?
1
vote
1answer
57 views

Importing adjacency matrix from file of 0/1 arrays

Is it possible to import adjacency matrix for graph representation, from simple text file with NxN (rows x columns) of 0s/1s: 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 0
4
votes
2answers
107 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 ...
1
vote
1answer
83 views

References on functions FindGraphPartition and FindGraphCommunties

Does somebody have some interesting references on the FindGraphPartition and FindGraphCommunties[.., Method -> "Spectral"] ...
0
votes
1answer
105 views

How do I upload a graph as an adjacency list and find the betweenness centrality?

I have an undirected simple graph in a .txt file formatted as an adjacency list like this: 100 200 200 300 300 400 500 600 700 800 900 ... Every number is a node ...
1
vote
2answers
94 views

How to sort the adjecency matrix of bipartite graph so to have two off-diagonal blocks

In a bipartite graphs there are two class of nodes, say A and B. Each node of class A may interact only with nodes of the class B, and viceversa. The corresponding adjecency matrix is thus composed by ...
1
vote
1answer
55 views

How do I visualize the result of EdgeColoring[g]?

Combinatorica has a heuristic edge-coloring function EdgeColoring. When I execute it on a graph, the result is a list of integers. My guess is that an integer $i$ ...
1
vote
0answers
49 views

Why does Network`GraphPlot`wrapper appear in my GraphPlot?

I'm making a GraphPlot of data similar to this: ...
7
votes
3answers
207 views

Different colors for nodes in tree plot

I have some list of numbers which I am plotting using TreePlot. This is the code: ...
6
votes
0answers
82 views

HighlightGraph and Hyperlink

In the documentation of Mathematica it is mentioned that you can use Hyperlink and Tooltip as wrapper in a similar manner as ...
1
vote
1answer
68 views

How do I use Subgraph to sample the $n$ vertices of a graph with the greatest connectivity?

Let $G$ be an arbitrary graph with some number of vertices $||V||$ and some number of edges $||E||$. We can use Subgraph to generate, well, a subgraph of ...
0
votes
1answer
73 views

How to efficiently distinguish the rewired edges in WattsStrogatzGraphDistribution?

The WattsStrogatzGraphDistribution function is a way to construct random graphs based on Watts and Strogatz small world model. The ...
2
votes
1answer
112 views

Plotting Network with LayeredGraphPlot with specific order

I have a network and want to plot it. I use LayeredGraphPlot, and the network is described as: ...
2
votes
0answers
53 views

Can BreadthFirstScan be modified?

I would like to obtain a "slick" implementation of A*-search algorithm on Graph objects, using the built-in BreadthFirstScan (if that is possible at all). I noticed that BreadthFirstScan is static in ...
3
votes
2answers
191 views

Horizontal Tree Layout? [duplicate]

I need to display arbitrary Expressions in TreeForm, but the standard vertical layout produces too many horizontally overlapping boxes. Am I doomed to rewriting ...
2
votes
1answer
52 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 ...
1
vote
1answer
34 views

Check Specific Connections within Graph

Say you have the skeleton of a graph: fullSkele = PolyhedronData["GreatRhombicosidodecahedron", "SkeletonRules"] and you've an arbitrary list of some fraction of ...
2
votes
2answers
108 views

How to make a recursive code from this iterative code? (drawing tree graph)

I have a question about drawing tree graph. I use my iterative code to build a tree graph. Here it is. ...
0
votes
0answers
43 views

Get correlation matrix when using FindGraphCommunities

Does somebody know how to get the correlation matrix when using FindGraphCommunities (Social Network analysis) using the "Spectra" option? Can somebody tell me as ...
1
vote
1answer
72 views

Social Network Analysis - Get the List of InBoundEdges for Directed Graph

I wish to get the list of inwards edges for a node. IncidenceList provides both inwards and outwards list. I can of course filter with ...
3
votes
1answer
145 views

Social Network Analysis - Get the End Points of an Edge

I want to get the end points of an Edge of a Graph. For example see the following source, ...
6
votes
2answers
283 views
0
votes
1answer
84 views
4
votes
1answer
119 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 ...
5
votes
3answers
330 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 ...
0
votes
1answer
137 views

Display a labeled multigraph

Despite the integration of graphs and networks, multigraphs are not supported in Mathematica 8+. In Mathematica 9+, GraphPlot misbehaves for multigraphs having ...
2
votes
0answers
88 views

Finding rings in a network

I am doing a research on networks which consist of polygons with different number of sides. Is there a way to find rings by BreadthFirstScan function. For ...
1
vote
1answer
57 views

Extracting a single weakly connected component from a network of many weakly connected components?

Hello Mathematica friends! I've got a network with thousands of edges and vertices, but not all in one connected component. I'm trying to extract specific connected components from the network, and ...
1
vote
1answer
93 views

How to import and visualize a network stored as an edge list in CSV file? [closed]

I'm extremely new to Mathematica, and I'm trying to import an edgelist representing a network, but I think I'm missing something major. Here is my process so far just to import and visualize the ...
1
vote
0answers
112 views

How to make Layer Directed Graphs (LDG) in mathematica?

I am wondering if I can make a graph like that somehow: I am new to mathematica, I tried to play with Creating a graph with variable size of vertices and variable thickness of edges . I figured if I ...
6
votes
3answers
185 views

Enumerate the 1-factors (perfect matchings) of $K_n$

Introduction I would like to enumerate the 1-factors, or (near-)perfect matchings, of the complete graph Kn. The adjacency list representation for Kn is basically { (x, y) | 1 ≤ x < y ≤ n }. For ...
5
votes
3answers
221 views

Nested list to graph

The following nested list can be regarded as a representation of a (tree) graph: ...
4
votes
1answer
53 views
4
votes
1answer
352 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 ...
2
votes
1answer
142 views

Saving a graph of a great number of nodes

I'm developing a code where I get graphs with over 10K nodes. These graphs have a particular relationship between clustering and degree that I need to save for future analysis. The problem is when I ...
5
votes
2answers
124 views

Improving performance in the generation of random (directed acyclic) graphs

I need to generate large (directed, acyclic, transitive) graphs. My code in Mathematica gets very slow for large numbers of vertices. I've tried a number of approaches and I can't find any significant ...
2
votes
0answers
91 views

Using Graph to cull correlated lists

I have a set of lists that represent molecular descriptors. I need to identify which descriptors are highly correlated and eliminate the correlated pairs. I can represent the connectivity by ...
3
votes
0answers
193 views

A* algorithm for finding shortest path in a graph

FindShortestPath finds the shortest path between two vertices in an edge-weighted graph, allowing a choice between the Dijkstra and Bellman-Ford algorithms. In my (limited) understanding, both of ...
6
votes
2answers
192 views

Flow/graph-based programming in Mathematica?

Is it possible in Mathematica to write a program inside a graph? For example if you have a bunch of different If[] statements that you need to embed within one ...
3
votes
1answer
165 views

Writing results directly to file

I am trying to find all simple paths in a large directed graph (542 vertex, density ~ 5%) between two nodes. For this purpose, I use the algorithm from this thread. Unfortunately, my computer is ...