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)

12
votes
0answers
172 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$ ...
9
votes
0answers
97 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 ...
8
votes
0answers
130 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-...
8
votes
0answers
111 views

Deleting zero edges from a graph causes bizarre behavior

Bug introduced in 10.3.0 and fixed in 10.4. Consider the following (very simple) graph, with two vertices and one edge: g = Graph[{1, 2}, {1 <-> 2}]; I ...
8
votes
0answers
89 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 <...
8
votes
0answers
92 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 ...
7
votes
0answers
271 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 ...
7
votes
0answers
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 ...
7
votes
0answers
403 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,...
6
votes
0answers
35 views

Minimal Spanning Tree with EdgeWeights

Given a graph with EdgeWeights, I'm finding the minimal spanning tree: ...
6
votes
0answers
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 ...
6
votes
0answers
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 (...
6
votes
0answers
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 ...
6
votes
0answers
109 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 <...
5
votes
0answers
99 views

FindMaximumFlow generates a weird result

Bug introduced in 10.0 and persisting through 10.4.1 Try the following program: ...
5
votes
0answers
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 ...
5
votes
0answers
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:
5
votes
0answers
83 views
5
votes
0answers
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 ...
5
votes
0answers
170 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 ...
5
votes
0answers
281 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-...
5
votes
0answers
556 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 ...
4
votes
0answers
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 <...
4
votes
0answers
154 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 ...
4
votes
0answers
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 ...
3
votes
0answers
79 views

A unexpected behaviour of RelationGraph

$Version "10.4.1 for Microsoft Windows (64-bit) (April 11, 2016)" I want to match the based point of VoronoiMesh(...
3
votes
0answers
142 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 ...
3
votes
0answers
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 ...
3
votes
0answers
58 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 ...
3
votes
0answers
181 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 ...
3
votes
0answers
60 views

Undocumented options for “BalloonEmbedding” in GraphLayout

From an error message, I see some options of the BalloonEmbedding method for GraphLayout: ...
3
votes
0answers
92 views

FindGraphCommunities method options?

FindGraphCommunitites has a couple of method options: "Modularity", "Hierarchical", ...
3
votes
0answers
99 views

Graph plotting: specify layers for layered drawing

Mathematica can do layered graph drawing with LayeredGraphPlot or GraphLayout -> "LayeredEmbedding". Is it possible to ...
3
votes
0answers
198 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 ...
3
votes
0answers
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 ...
3
votes
0answers
282 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, ...
3
votes
0answers
72 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
0answers
546 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 ...
3
votes
0answers
323 views

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

Here is a graph whose adjacency matrix is ...
2
votes
0answers
59 views

How to label some properties into graph like labeling EdgeWeight

We can label the EdgeWeight into edge like following ...
2
votes
0answers
112 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 ...
2
votes
0answers
83 views

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

Suppose I have an undirected graph ...
2
votes
0answers
93 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,...
2
votes
0answers
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 ...
2
votes
0answers
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....
2
votes
0answers
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: ...
2
votes
0answers
74 views

Choosing a List as VertexWeight for a TreeGraph

I would like to map every vertex of my TreeGraph to an List. ...
2
votes
0answers
107 views

Belief Network, Bayesian network

There is already a question about simulating Bayesian networks with Mathematica (Mathematica Package for Bayesian Networks). However, are there any packages or approaches which help in computing the ...
2
votes
0answers
78 views

Spread multiple edges by a specified scaled distance (Mathematica 10)

Is there way to spread multiple edges by a specified scaled distance for Graph function in Mathematica 10, something similar to MultiedgeStyle in GraphPlot for example, I would like to write: ...
2
votes
0answers
78 views

What Algorithm Does Mathematica use to Calculate Betweenness Centrality for Unweighted Graphs?

I recently asked this question on the Mathematics SE. Does anyone know, as a follow up, what algorithm Mathematica uses to calculate the betweenness centrality vector (of $N$ elements) for an ...