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
1answer
15 views

Plotting the complement of a graph without changing the name of the vertices

I have a graph in the form {Dog -> Apple, Apple -> Screwdriver}, I used to plot a graph in the following way: GraphPlot[{Dog -> Apple, Apple -> Screwdriver}] I'd like to plot the complement of the ...
3
votes
2answers
100 views

Visibility Graph of Polygon

Could anyone provide a function that takes a polygon as input and outputs its visibility graph ? Visibility Graph If not, is there a function that checks whether a line segment lies inside a polygon? ...
1
vote
2answers
38 views

Plotting points using adjacency matrix

Given an adjacency matrix on n vertices and a polygon on n vertices, how to add edges from adjacency matrix on the Polygon? eg: if polygon is {(0,0),(0,1),(1,0),(1,1)} and the adjacency matrix has 1 ...
2
votes
0answers
47 views

How to understand the LocalClusteringCoefficient use in directed graph? [duplicate]

When this function use in undirected graphs,its action is normally and can be explained by this formula $$CC_v=\frac{n}{C_{k}^{2}}=\frac{2n}{k(k-1)}$$ n is adjacent nodes of $v$'s number of ...
2
votes
2answers
440 views

Convert DelaunayTriangulation-> Graph->AdjacencyMatrix

Is there a way to convert a Delaunay Triangulation into a Graph structure so that one can generate an AdjacenyMatrix of the Delaunay?
-2
votes
0answers
24 views

Graph coloring - edges - algorithm tweak [on hold]

I was kind of heedless and read wrong assignment task. I wrote an algorithm that finds the minimum numbers of colors in graph for vertices. And when I finished it, not i read the assignment task ...
3
votes
0answers
74 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(...
18
votes
2answers
1k views

How to export and import Graphs with additional data?

I'm trying to export and then later import graphs with additional data added such as VertexLabels and EdgeLabels. When I export ...
0
votes
2answers
30 views

Finding vertices with a given degree; or, finding indices

I have a graph g and would like to find all the vertices in g with degree n. ...
1
vote
1answer
58 views

Permutations on graph vertex labels

I want to generate all the possible adjacency matrices of equivalent unlabeled graphs. For example, consider the simple path graph of three vertices. There are three possible adjacency matrices: ...
6
votes
2answers
89 views

Tree graph showing all simple paths with dead ends between two vertices in undirected graph

I have undirected weighted labeled graph. How i can generate and visualize tree graph, showing me all simple paths (and dead ends) from vertice A to vertice B? For example, for this graph to show ...
0
votes
0answers
19 views

The command SocialMediaData still returns a blank plot [duplicate]

I have Mathematica 10.3.1 in Mac OS, and the command SocialMetaData is not working, returning a blank plot. I have seen a similar question from Nov 28 '15, but it is still not solved. ...
6
votes
0answers
99 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 ...
0
votes
0answers
5 views

Prove that the converse of a strong digraph is also strong [migrated]

I would like to know how I prove this. The converse of a digraph D is obtained from D by reversing the direction of every arc of D. Show that a digraph D is strong if and only if its converse is ...
0
votes
1answer
117 views

Objects - fixed properties [closed]

How do I set properties of graphs permanently? Is there any way? For example VertexLabels -> "Name". I would like to see labels, always when I open a new ...
4
votes
1answer
53 views

Generate graphs from the output of GraphAutomorphismGroup

Given g = Graph[{1 -> 2, 2 -> 3, 3 -> 1, 4 -> 1, 1 -> 5, 5 -> 4}, VertexLabels -> "Name"] GraphAutomorphismGroup[g] outputs ...
3
votes
1answer
80 views

Replicate CommunityGraphPlot as a Graph

Is it possible to format a Graph object in a similar way to CommunityGraphPlot, but retain it as a Graph? I've been playing with FindGraphCommunities but I'm obviously missing some of the ...
5
votes
1answer
81 views

Is it possible to use a function for EdgeWeight in a Graph?

Why I cannot calculate all edge weights beforehand: I have many large graphs for which I'd like to find the shortest path between two vertices (FindShortestPath ...
0
votes
1answer
32 views

Incidence matrix not reproducing the graph

I am trying to reproduce the graph from an incidence matrix. For eg i have ...
9
votes
2answers
152 views

HighlightGraph Problem

Bug introduced in 9.0 or earlier and persisting through 10.4.1 HighlightGraph does not work. ...
6
votes
0answers
32 views

Minimal Spanning Tree with EdgeWeights

Given a graph with EdgeWeights, I'm finding the minimal spanning tree: ...
4
votes
1answer
125 views

Styling a FlowGraph

I tried to re-style a flow graph found via FindMaximumFlow, but this seems not to work: ...
1
vote
1answer
70 views

Vertex sizes scaled by vertex degree?

Is there any way of scaling the sizes of the vertices of a network proportional to the vertex-degrees of the vertices in Mathematica? Thanks.
5
votes
1answer
204 views

How to find giant component of a network?

Is there a specific command in Mathematica 9 or 10 to extract the largest component of a given network which has one large and many small components? The ...
11
votes
2answers
197 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? ...
7
votes
1answer
81 views

How to remap graph properties?

Graph objects support both custom properties, which do not have special meanings, and standard properties, which may be used by some functions. When importing from ...
4
votes
2answers
72 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: ...
3
votes
1answer
32 views

Existence of edge in graph

I want to know whether an edge exist between two specific vertex? Is there any function like EdgeExist[g,{v1,v2}]?
1
vote
1answer
63 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 ...
2
votes
1answer
66 views

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

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

min distance in a graph

How would I find the min distance between two vertices in a graph. What function should I use? For example, in the above, $d(2,4)=2$ and $d(2,3)=1$
8
votes
0answers
126 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 ...
8
votes
0answers
88 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
149 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
122 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 ...
5
votes
0answers
123 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
772 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
252 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
128 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
139 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
161 views

Alignment of `TreePlot`

I want to construct a binomial tree using TreePlot but have troubles with the alignment. The code ...
7
votes
1answer
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 ...
2
votes
1answer
76 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
731 views

Building graph based on the cities connection?

I built a Graph based on the permutations of city's connections from : ...
1
vote
0answers
38 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
215 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 ...