# Tagged Questions

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

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 <...
143 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 ...
133 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 ...
151 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 ...
50 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}] ...
40 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 ...
125 views

### A unexpected behavior in RelationGraph

Bug persisting through 10.4.1 Firstly we get these idiom ...
51 views

### None connected graphs for n=59? [closed]

For some reason GraphData["Connected", 59] gives no graphs, is this a bug?
47 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 ...
163 views

I googled for images of graphs and found nothing that even comes close to this one, so I want to experiment some more. ...
63 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 ...
116 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 ...
162 views

### How to get the Perfect Matching or Near-Perfect Matching

I have found the Perfect Matching'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 ...
27 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 ...
200 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 ...
63 views

### DirectedEdges -> False not working

Consider this graph, that I downloaded from the OpenConnectome project. Graph[EdgeList[cElegans], DirectedEdges -> False] // DirectedGraphQ outputs: ...
258 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 ...
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? ...
106 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 ...
67 views

### How do I display a graph theory problem? [closed]

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 ...
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 ...
61 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 ...
128 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 ...
70 views

### Some strange graph from “RelationshipGraph”

I want use this code to graph the all of function in image-processing. ...
84 views

### Reverse the layout when using “DiscreteSpiralEmbedding”

I have a graph such as NestGraph[# + 1 &, 1, 10, GraphLayout -> "DiscreteSpiralEmbedding", VertexShapeFunction -> "Name", VertexSize -> .2] But ...
27 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 ...
101 views

My graph is ...
72 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 ...
80 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. ...
84 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 ...
64 views

### How can I code a graph visibility criterion using an If-statement?

The visibility criterion can be defined as follows: two arbitrary data values $(ta , ya)$ and $(tb , yb)$ are visible to each other if any other data $(tc, yc)$ placed between them fulfills the ...
41 views

### Certainty of the New Vertex Name after using EdgeContract

It appears that when I use EdgeContract on an undirected graph, the vertex that is the result of contracting an edge is always named the smaller of the two vertices....
18 views

### Why does Mathematica report the VertexEccentricity of a disconnected vertex as zero?

"For a disconnected graph, all vertices are defined to have infinite eccentricity" So, why does Mathematica report the VertexEccentricity of a disconnected vertex as 0 instead of ...
26 views

### VertexContract, VertexReplace and non-anonymous collapsed node

Can the standard VertexContract or VertexReplace functions display a name for the collapsed node ? Here is a minimal example: <...
55 views

### Trying to remove duplicate isomorphic graphs in a list of graphs [duplicate]

I am working on a Mathematica program that involves taking a graph and generating all of its single-edge contractions. When I get this list of contractions, it often happens that many of the graphs ...
65 views

### How can I get the arguments of the function Graph?

If I have f0 = f[x,y,z] and I am interested in the list of the arguments, what I do is ...
150 views

### Petrie polygon projection of a hypercube graph

I am trying to generate the Petrie polygon projection of the 8-cube in Mathematica, like this one: I tried using, for example, the HypercubeGraph function: ...
15 views

### Acyclic Directed Graph, NeighborhoodGraph and ancestors [duplicate]

What is the correct way of find the list of a given vertex' ancestors in an ADG ? I am thinking that a pattern in NeighborhoodGraph might be the solution or a negative option for the degree of ...
67 views

### Find independent vertex sets

I'm trying to find all independent vertex sets for a given graph. Note that they may not be maximal independent sets. There is a function in Mathematica called ...
238 views

### Plot a 3-cycle graph with clockwise-directed edges

When I try to plot a 3-cycle, the edge direction is always counter-clockwise. The plotting code is ...
119 views

### Small World network on a square grid

My aim is to generate a 2D Small World network on a square grid. i.e. 20x20. With a probability of 5%, one node rewires from an adjacent node to a random node of the grid, allowing some long distance ...
119 views

### How to make a flowchart? [closed]

I'd like to make a flow chart in similar to this: I think it's more of a layout and stylistic question for a graph - how to style a graph with labeled edges and vertices so that it looks like a ...
49 views

### Trying to get simple excel data to be imported as a social network directed graph

My data has two columns that we'll call A and B. The columns proceed as such A B A1 B1 A2 B2 A3 B3 .... I'm trying to make this into a directed graph where A1 has an outgoing edge to B1 and ...
83 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 ...
105 views

### Random bipartite graphs?

RandomGraph[{n,m}] generates a random graph with $n$ vertices and $m$ edges. I want to generate a random bipartite graph, like ...
106 views

### VertexDelete Problem

I am doing a straightforward deletion of a set of vertices in a Tree using Mathematica. ...
123 views

### How can I make this code to count Hamiltonian paths faster?

I have this very basic code to count Hamiltonian paths in a graph: ...
91 views

### Arrows from GraphicsComplex not converted to Normal form correctly

Bug introduced in 7.0 or earlier and persisting through 10.4.0 Show @ Graph[{1 -> 2, 2 -> 3}, Frame -> True] Normal @ % Is this a pure bug, or have ...
I'm trying to figure out how to plot a graph on a surface. My goal is to represent a planar embedding of $K_5$ in a torus. I have encountered this post, where you can find an explanation how to plot ...