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
0answers
26 views

How to enlarge a specific part of a graph using Plot Command?

How to enlarge the closed curves of any Graph and Show them in a separate Graph within the ...
3
votes
1answer
41 views

Why is `FindCycle` crashing for this graph?

I'm working with a directed graph, previously mentioned in Exporting a high-resolution GraphPlot of a very large graph (65,536 nodes). It can be generated with the following code: ...
8
votes
0answers
106 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 ...
6
votes
1answer
132 views

Is it possible to get the (x, y) position of nodes in a `Graph`?

Given a graph... RandomGraph[{20,40}] ...is it possible to retrieve the (x, y) coordinates at which the nodes are drawn? ...
8
votes
0answers
87 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 ...
5
votes
1answer
145 views

Efficiently importing data into Mathematica

I have a graph data file infile.txt. 3 2 0 1 1 2 3 2 0 1 2 1 3 2 1 0 1 2 3 3 0 1 1 0 1 2 3 3 0 1 1 0 2 1 3 4 0 1 1 0 1 2 2 1 ...
4
votes
2answers
113 views

A unexpected behavior in RelationGraph

Bug persisting through 10.4.1 Firstly we get these idiom ...
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
104 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 ...
14
votes
3answers
752 views

Vizualization of percolation paths

I did a simple demonstration to illustrate the percolation theory for my students. The content is a conductive square network possessing electrodes at its top and bottom edges. Some randomly chosen ...
0
votes
1answer
48 views

How to change the bipartite into a normal form

If we have a bipartite,we can change its form into a normal form like this g1 = GraphData[{8, 579}] ...
8
votes
2answers
235 views

Constructing a graph from a distance matrix

I have a set $S$ of $n$ 2-dimensional points. We can compute a distance matrix (Euclidean distance) for $S$ using say this answer. I wish to form an $n$-vertex graph having the points $S$ as vertices, ...
3
votes
0answers
105 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 ...
7
votes
1answer
125 views

How to convert a graph to a mesh region

As we know,the region is very convenient in Mathematica.And we can convert a MeshRegion into graph like this ...
9
votes
3answers
1k views

Finding face vertices from the face adjacency graph

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

Alignment of `TreePlot`

I want to construct a binomial tree using TreePlot but have troubles with the alignment. The code ...
7
votes
1answer
132 views

Vertexes possibility estimate in graph

I have graph which represents runner race events. Vertex means runner, edge means running event between runners, edge weight is how much more seconds runner won running race against opponent. (running ...
2
votes
1answer
72 views

How to get the Perfect Maching or Near-Perfect Matching

I have found the Perfect Maching's definition in Wiki. A perfect matching (a.k.a. 1-factor) is a matching which matches all vertices of the graph. That is, every vertex of the graph is incident ...
10
votes
5answers
725 views

Building graph based on the cities connection?

I built a Graph based on the permutations of city's connections from : ...
1
vote
0answers
34 views

Is this a bug between RelationGraph and BipartiteGraphQ?

Inspired by yode's latest question I was playing around with RelationGraph and found that BipartiteQ seems to be unable to ...
1
vote
1answer
40 views

None connected graphs for n=59? [closed]

For some reason GraphData["Connected", 59] gives no graphs, is this a bug?
1
vote
2answers
196 views

Chromatic number for “great circle” graph

I would like to calculate the chromatic number for a great circle graph. I tried this example in this link. I first tried to calculate the chromatic number for ...
3
votes
2answers
158 views

Question about this Sieve of Eratosthenes graph

I googled for images of graphs and found nothing that even comes close to this one, so I want to experiment some more. ...
20
votes
1answer
1k views

How to divide the wine into two equal portions

There is a 8-liter bottle is full of wine. There are two empty bottles that have capacity 5-liters and 3-liters. How can these three bottles be used to separate the wine into two 4-liter portions? ...
3
votes
1answer
40 views

Use (network) graph as vertex

I have a Markov chain with graphs as the states. Basically how one network structure would evolve to another in the next period. To avoid confusion, I'll use the term "network" instead of "graph". I ...
0
votes
0answers
60 views

Enumerating all orientations of an undirected graph

Given an undirected graph $G$, an orientation of $G$ is a directed graph obtained by assigning every edge a direction, a superorientation of $G$ is a directed graph obtained by orienting every edge in ...
2
votes
2answers
110 views

How to extract the structure of relationships amongst variables in a system of equations? [closed]

Mathematica being a CAS, I would have thought what I'm trying to do a natural task. But I have not been able to find any information on this in the Internet. Basically, I have a large collection of ...
1
vote
1answer
48 views

Deleting vertices from Graph and preserving Structure?

My goal is to remove vertices from graphs (and the edges from them) and then take GraphComplement to find out cut sets in graphs with sink and source such as here. So How can I delete vertices from a ...
0
votes
0answers
20 views

Different edge Weights for edge Graph

I have a weighted Grid Graph with Diagonal Edges (nXm). I want to add different cost to the parallel edges. All Horizontal(0°-->) will have edgeweight of 1.8 All Horizontal(180°<--) will have ...
1
vote
1answer
43 views

How to make a disconnected graph to be 1-edge-connected(but not 2-edge-connected) with some shortest edge

Assume I have a graph.You can run following code to get it. Import["http://goo.gl/NaH6rM"]["http://i.stack.imgur.com/EyAKW.png"] It is a disconnected graph.But ...
10
votes
4answers
238 views

Tom's family how to cross the bridge

A interesting question.Tom's family just have a flashlight which will extinguish after 30 seconds.They wanna go through a bridge to arrive opposite side with the flashlight.But as the picture,they ...
1
vote
1answer
61 views

DirectedEdges -> False not working

Consider this graph, that I downloaded from the OpenConnectome project. Graph[EdgeList[cElegans], DirectedEdges -> False] // DirectedGraphQ outputs: ...
2
votes
1answer
100 views

How to find the shortest path going through some specified vertices

I have a grid graph g = GridGraph[{12, 12}, VertexLabels -> "Name"] We can find a shortest from 1 to 144 ...
0
votes
1answer
61 views

How do I display a graph theory problem?

If I have several nodes and the distances that they have between one another, how do get Mathematica to display this as a graph? And also maybe define this graph in such a way that I can then use ...
1
vote
1answer
111 views

Import graphml file in mathematica

I am trying import a graphml file I created with NodeXL in mathematica in order to create a network. However when i try to import it I get the error message: "Cannot import data as GraphML format". ...
3
votes
0answers
30 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 ...
4
votes
1answer
147 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 ...
1
vote
0answers
57 views

How-to make large graph more readable?

One day, I found myself curious about different topics in mathematics. So, I stumbled uppon a website (considerably old website) where author has tabularized mathematics into subjects and associated ...
4
votes
4answers
114 views

GridGraph with diagonal edges

I have n x n GridGraph (or n x m), I trying to add diagonal edges for each square box automatically and then assign same weights to the diagonals, same weights to horizontal edges and same weights to ...
3
votes
3answers
78 views

Reverse the layout when using “DiscreteSpiralEmbedding”

I have a graph such as NestGraph[# + 1 &, 1, 10, GraphLayout -> "DiscreteSpiralEmbedding", VertexShapeFunction -> "Name", VertexSize -> .2] But ...
2
votes
1answer
66 views

Some strange graph from “RelationshipGraph”

I want use this code to graph the all of function in image-processing. ...
3
votes
1answer
26 views

How to get the VertexWeight list or EdgeCapacity list in a graph

The graph of Mathematica.We have VertexList or EdgeList.So we can get it convenient like ...
3
votes
1answer
67 views

How to make the graph to specific layout

For the artistic,the graph layout could be more important sometimes.So I must to put a bad sentence to describe the clumsy GraphLayout of ...
19
votes
2answers
371 views

Reconstruct a graph from an image (curved edges and edge crossings)

Actually, I posted a very similar question before this.How to generate a Graph from a picture of a graph Dr. belisarius's answer have answered that question, but I find a limitation in that method: ...
4
votes
1answer
72 views

Odd behaviors of FindKPlex

Bug introduced in 9.0 and persisting through 10.4 FindKPlex is new in 9.0. I have a example about it. ...
2
votes
2answers
630 views
11
votes
2answers
743 views

Convert Graph to Graphics

In Mathematica 9, a graph is returned as an object with head Graph: In[1]:= CompleteGraph[8] // Head Out[1]= Graph ...
0
votes
2answers
77 views

How to make a graph form imported spreadsheet data [closed]

I've three csv files: v.csv for vertex data, like this: 1 2 3 ... e.csv for edges: 1,2 2,4 2,24 3,1 ... and vcoor.csv for vertex coordinates: 23.4, 35.2 23.4, 40.3 ... I know how to construct a ...
11
votes
5answers
4k views

How to generate and draw simple bipartite graphs?

A bipartite graph is a graph whose vertices can be divided into two disjoint sets. Given two lists: {1, 2, 3} and {x, y, z}, ...