# Tagged Questions

Questions about handling graphs in Mathematica, graph theory, graph visualization, GraphPlot, the built-in Graph type and the Combinatorica package.

180 views

### A question about weighted graphs

Bug introduced in 8.0 or earlier and persisting through 10.3 I need create a weighted graph with given data. Number of nodes: $53$ $\quad$ Number of edges: $91$ ...
208 views
+200

### What does the GraphLayout -> “SpectralEmbedding” option do (mean) when displaying a graph?

I have some relational data represented as a graph. As such some of the relational properties can be recognized. When I use the GraphLayout -> "SpectralEmbedding" option a very nice and sharply ...
98 views

### Set new edge capacity

Bug introduced in 9.0 or earlier and persisting through 10.3.1 I am trying to add a new edge to an existing graph and set its capacity, but for some reason the ...
97 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 ...
136 views

### Exporting a high-resolution GraphPlot of a very large graph (65,536 nodes)

Problem I have a very large graph of 65,536 vertices. GraphPlot yields: But the vertices are too dense to see in any detail, and attempting to use any of the on-...
93 views

### More efficient way to generate lattice graph with edges between visible vertices?

Given a nXn lattice, I need to generate the graph such that there is an edge between two vertices iff they are directly "visible" to each other, i.e., there is no vertex between them. I'm using <...
277 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 ...
49 views

### What system functions use VertexWeights?

EdgeWeights -> are used by a lot of functions, but I can't find any exposed usage for VertexWeights ->. I'm not asking ...
408 views

### How to draw hypercube graphs

I'd like to draw hypercube projections like those on the Wikipedia page: I tried with HypercubeGraph[6] but the graph does not look right; it is not symmetric,...
39 views

### Minimal Spanning Tree with EdgeWeights

Given a graph with EdgeWeights, I'm finding the minimal spanning tree: ...
103 views

### Issues adding properties to multigraph

Unsupported Functionality (loosely, a bug) Mathematica (as of 10.4.1) does not support multi-graph where edge properties vary between two nodes that share multiple edges. Although this is not ...
72 views

### Functionality of FindMaximumFlow

I know that the superseeded function NetworkFlow (needs Combinatorica) uses Goldberg-Tarjan's Push-Relabel-Algorithm but i cant find any information on Mathematica's built-in-function (...
65 views

### VertexDelete not working on graph with VertexWeight

Bug introduced in 10.0 and fixed in 10.3 Good afternoon, I have observed an "unexpected behaviour" with VertexDelete and a graph with vertex weights. This is a minimal working example: OK ...
109 views

In the documentation of Mathematica it is mentioned that you can use Hyperlink and Tooltip as wrapper in a similar manner as <...
104 views

### FindMaximumFlow generates a weird result

Bug introduced in 10.0 and persisting through 10.4.1 Try the following program: ...
129 views

### Graphs' options vs JournalArticle stylesheet

Bug introduced in 10.4 and persists through 10.4.1 [...] This GridGraph behavior does appear to be a regression in Mathematica 10.4 from earlier versions. As ...
54 views

### What's meaning of VertexConnectivity`?

Are there a conflict in this two place in documentation? In the Basic Examples: Then the Properties & Relations But actually:
85 views

The graph ...
130 views

### Number of 4-colorings of Johnson solids

I want to know the number of 4-colorings for all Johnson solids. This is equivalent to evaluating the flow polynomial for the corresponding polyhedral graphs at $k=4$. I tried the following to get ...
175 views

### Finding quasi-cliques

What is the best way to identify quasi-cliques in a graph in Mathematica? I don't think it has been implemented, so are there any solutions to do this? Or do I have to export the graph data somehow ...
284 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 "command-...
559 views

### Finding a Graph Shortest Path with Custom Graph Distance Function

What is the best way to find a shortest path by using a custom distance function? I'm trying to play a little bit with the concept of using distributions instead of a deterministic weight value for ...
51 views

### Why NearestNeighborGraph gives different result for numerical List and exact List

In mathematica 10.3 there is a function called NearestNeighborGraph. I found some behavior of it that I don't understand. First I generate a 2D list like this <...
157 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 ...
140 views

### Efficient Generation of Subgraphs (or, unfriend a friend a day)

NB: If you're not interested in the back-story, you could simply jump forward to the code which I'm seeking to optimize. Also, I believe this code would only work for MMA 8.0 and above. My friends ...
63 views

159 views

### Neural network playground

I came across this Neural Net Playground demonstration based on Google's Tensorflow package. It visualizes the data processing inside a neural network and allows you to tweak parameters and ...
32 views

### WeightedAdjacencyMatrix does not complete for Connected Graph

Please see code snippet below - I have a weighted, connected graph that models a software process using a DiscreteMarkovProcess. I set some of the edge weights to ...
59 views

### How best to use or to emulate the “obsolete” Combinatorica command Contract?

The obsolete Combinatorica package has a command Contract for contracting an edge in a graph. Below is my very clunky attempt to work with up-to-date graph objects ...
182 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 ...
60 views

### Undocumented options for “BalloonEmbedding” in GraphLayout

From an error message, I see some options of the BalloonEmbedding method for GraphLayout: ...
94 views

### FindGraphCommunities method options?

FindGraphCommunitites has a couple of method options: "Modularity", "Hierarchical", ...
105 views

### Graph plotting: specify layers for layered drawing

Mathematica can do layered graph drawing with LayeredGraphPlot or GraphLayout -> "LayeredEmbedding". Is it possible to ...
201 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 ...
77 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 ...
287 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, ...
72 views

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 ...
559 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 ...
323 views

### How to compute the Lovász number for the given graph in Mathematica?

Here is a graph whose adjacency matrix is ...
61 views

### How to label some properties into graph like labeling EdgeWeight

We can label the EdgeWeight into edge like following ...
115 views

### Incompability between v5-6 and v10 with Graphs and Oriented Graphs pkgs?

Notice that "although the v6 Packages are available at the link in the answer above they are not fully compatible with v10". The errors 1, 2 and 3 in Mathematica 10 student edition may be due to ...
84 views

### How do I get all possible paths in terms of edges, and not vertices in Mathematica?

Suppose I have an undirected graph ...
99 views

### Graph, overlapping vertexlabels

The graph I create is based on more then 1000 different word-combinations. A example looks like this: text = {{word, word1}, {word1, word2}, {word1, word3}, {word,word4}, {word,word5}, {word,...
50 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 ...
59 views

### Bugs in VertexContract function?

I think there may be two bugs in the VertexContract function: 1) The updated graph does not include reasonable edgeweights 2) The function does not actually reduce the number of vertices in the graph....
96 views

### Is there a minor bug in Neal Alexander's TopologicalSortAll[]?

There is an amazing answer to this question: All possible topological orderings of a graph By Neal Alexander. However, as user "dark blue" (I am not this user) notes: ...
75 views

### Choosing a List as VertexWeight for a TreeGraph

I would like to map every vertex of my TreeGraph to an List. ...