Questions tagged [graphs-and-networks]

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

Filter by
Sorted by
Tagged with
2 votes
0 answers
20 views

Functions with graph vertix

I am new to Mathematica, trying to use it to study network structure. I am having trouble with creating this code. Here are the steps I need to do: First, generate a graph. Let's say a regular graph ...
user avatar
0 votes
2 answers
42 views

How to adjust the shape of some multiple edges of a graph separately?

The graph we drew below using TikZ is easy. ...
user avatar
  • 1,069
0 votes
1 answer
31 views

ListLinePlot Options Expecter Error

The Problem I am trying to plot a ListLinePlot, and despite it being only a modified version of a working code, it now isn't working. It gives the error: ListLinePlot::nonopt (i.e. Options Expected ...
user avatar
  • 471
1 vote
0 answers
54 views

Removing GraphHighlight from highlighted graph

What is the problem with the following code? Annotation GraphHighlight should be deleted but it is still present in the graph: ...
user avatar
  • 2,842
0 votes
0 answers
37 views

A new problem about finding more information about two non-isomorphic graphs

This question is a follow-up to the question I asked earlier. Wish more readable information from IsomorphicGraphQ Using Mathematica, we can easily determine that the following two graphs are non-...
user avatar
  • 1,069
1 vote
1 answer
56 views

Comparing network graphs [closed]

I started out with a grid graph, performed some operations on it, and ended up with a set of networks; for example, , , , I need to compare these graphs. A thought that I had was to compare them with ...
user avatar
  • 422
2 votes
0 answers
127 views
+50

Speeding and avoiding unwanted crash of nested Table by `NearestNeighborGraph`

I have a code that generates coordinate points for a 2 dimensional lattice. So the coordinates are of the form {x,y}. Now, I generate a graph out of these ...
user avatar
  • 571
6 votes
1 answer
77 views

Shortest path through more than two points visiting vertices once

FindShortestPath works only with two points. Is there a function that finds shortest path among more than two vertices in specified order and never visiting any ...
user avatar
  • 2,842
11 votes
2 answers
1k views

How to fit many graphs neatly into a paper?

I got a graph list containing 110 highly irregular graphs with 12 vertices in the following link. http://users.cecs.anu.edu.au/~bdm/data/graphs.html ...
user avatar
  • 1,069
4 votes
2 answers
206 views

Minimizing the combined neighbourhood of a path in a grid graph

Given two vertices in a simple grid graph, how to find the path connecting them such that the combined neighbourhood of the vertices in the path is the smallest? Consider this path between the ...
user avatar
  • 422
2 votes
2 answers
108 views

Invert undirected graph edge

Suppose I have a list of edges, {1 \[UndirectedEdge] 2, 1 \[UndirectedEdge] 3} How do I get the 'invert' of the list, ...
user avatar
  • 422
1 vote
1 answer
41 views

Change size of specific set of vertices in a graph

I have a graph with over 2000 vertices, and I would like to change the size of around 25 of them. I know that I can specify the size of each of them individually, but I would like to be more ...
user avatar
  • 33
2 votes
1 answer
99 views

Can the vertex size be reduced when importing a GML-formatted graph?

I have got a graph in GML format (see attachment). I imported it on the Mathematica. g=Import["~/K33_2.gml ", ImagePadding -> 10] With the guarantee ...
user avatar
  • 1,069
6 votes
2 answers
192 views

FindShortestPathTree superseded by FindSpanningTree?

The on-line documentation for FindShortestPathTree (part of the Combinatorica package) says: "ShortestPathSpanningTree has been superseded by FindSpanningTree" I don't understand how to use ...
user avatar
  • 471
2 votes
1 answer
66 views

3D-graphing the $E_8$ root system/ $4_{21}$ polytope

I'm trying to recreate on Mathematica the 3D graphs $4_{21}$ polytope as seen here and here. My idea would be to obtain a 3D-graph so that I can then add some thickness to the edges and export it as a ...
user avatar
1 vote
0 answers
133 views

Can OGDF (a self-contained C++ library for graph algorithms) be integrated into Mathematica?

I would like to begin by congratulating IGraphM on the release of its current update (M 0.6.1). This package makes graph calculations on Mathematica much smoother. The specifics are available at the ...
user avatar
  • 1,069
0 votes
0 answers
31 views

SetOptions not working with PlotStyle option in GraphPlot

While both GraphPlot[graph,PlotStyle->Orange] and, SetOptions[Plot,PlotStyle->Orange];Plot[x^2,{x,0,1}] works. ...
user avatar
4 votes
3 answers
171 views

How to get a list of the values in this Graph object?

This graph gives the loops of these rules clearly. Graph[Thread[RandomSample[Range[100]] -> RandomSample[Range[100]]], VertexLabels -> "Name"] ...
user avatar
  • 1,327
15 votes
2 answers
388 views

Is a list of all graph layouts available?

Is a list of all graph layouts available? For example I want to check all the layouts at once for a specific graph so I'll map this over the list. Of course you can just type the list yourself but ...
user avatar
  • 2,419
2 votes
1 answer
133 views

An inverse problem of cartesian product operation of two graphs [closed]

In graph theory, the Cartesian product $G ▢ H$ of graphs $G$ and $H$ is a graph such that: the vertex set of $G ▢ H$ is the Cartesian product $V(G) × V(H)$; and two vertices $(u,u' )$ and $(v,v')$ ...
user avatar
  • 1,069
6 votes
1 answer
135 views

How can I make the vertices of a tree graph clickable?

Would it be possible to make the vertices of a tree graph clickable, executing a function when clicked? Specifically, I am using Mathematica / the Wolfram Language to prototype a modern, microtonal ...
user avatar
6 votes
1 answer
142 views

Layout improvements for planar graph

I recently used Cage software to generate a 24-vertex planar graph. All details of the graph are as follows, including the coordinates of each of its vertices. I know it is 3-connected. ...
user avatar
  • 1,069
6 votes
1 answer
105 views

Curved edges with GraphElementData no longer working in Mathematica 13.1

I just noticed that it seems no longer possible to get curved edges on graphs in Mathematica 13.1 using GraphElementData. For example, the following code works on versions 12.x: ...
user avatar
5 votes
1 answer
94 views

How to find all the vertices of graph that have the same status as a vertex $v$?

We sometimes say that in a graph $G$ two vertices $a$ and $b$ look the same. In layman's terms, this means that $a$ and $b$ are of same status. Precisely, there exists a auto-isomorphic mapping of $G$...
user avatar
  • 1,069
2 votes
1 answer
44 views

Strange Vertex Size Problem when Moving From 999 to 1000 Verteces

I have a problem with Graph plot scaling of vertex sizes when I go from 999 vertices to 1000 vertices. The following code scales the vertex size properly when the numNodes = 999; but not numNodes = ...
user avatar
2 votes
2 answers
203 views

Restores a difficult digraph

I want to reconstruct this picture,like this: I have do some work,this is my code ...
user avatar
2 votes
1 answer
55 views

Adding an edge between G1 vx and G2 vy?

I have two random graphs G1 and G2 that I want to join with an edge from a particular vertex vx in G1 to a particular vertex vy in G2. I can't find a way to do it. Here is my latest code: ...
user avatar
10 votes
1 answer
383 views

Can Mathematica read planar graphs with pc format?

We can download files about some special planar graphs at the following website, but their files are suffixed with pc. http://users.cecs.anu.edu.au/~bdm/data/planegraphs.html I don't know how to ...
user avatar
  • 1,069
5 votes
1 answer
173 views

Finding connected components in 2D integer coordinate system

Let L be a finite set of pair of integers. I want to partition L according to connectivity The connectivity is intuitive : Rule1 ...
user avatar
  • 3,063
-2 votes
1 answer
89 views

Could a function such as Slot be used in this genetic code analysis? [closed]

...
user avatar
  • 583
1 vote
1 answer
77 views

NestGraph Basics

Summary How does NestGraph build a graph? Example Column[NestList[{2 #, 2 # + 1} &, 0, 2]] 0 {0, 1} {{0, 2}, {1, 3}} Now NestGraph[{2 #, 2 # + 1} &, 0, 2, ...
user avatar
  • 51
3 votes
0 answers
53 views

Mathematica failing to export consistent layout

Mathematica is a great tool but when it comes to layout generation is quite poorly intuitive: I would love that exporting to images and SVGs could be more friendly and compliant with graphic design ...
user avatar
3 votes
1 answer
113 views

Can you count the number of self-loops per vertex in a graph?

In this graph, such output would be: 0 self-loops for vertex w, 1 self-loop for vertex c, 6 self-loops for vertex ...
user avatar
  • 583
4 votes
0 answers
104 views

Need some Graph Invariant Computations

I have found a list of graph invariants at the house of graphs (HOG) here. I am able to compute almost all of them with Mathematica and IGraph/M. I am missing computations for the following: Genus, ...
user avatar
1 vote
1 answer
79 views

GraphUnion in Mathematica 12 vs 13

In Mathematica 13, GraphUnion[g] returns g. In Mathematica 12, in what I can only think is a bug, the same code returns ...
user avatar
  • 203
2 votes
1 answer
94 views

Calculating distance between a set of random points in hyperbolic space

Given the metric of the Poincaré upper half-plane model $$(ds)^2 = \frac{(dx)^2 + (dy)^2}{y^2}$$ and two known points $(x_1, y_1)$ and $(x_2, y_2)$ in the corresponding hyperbolic space $\mathbb{H} = \...
user avatar
  • 1,599
2 votes
1 answer
55 views

CommunityGraphPlot colors the communites automatically. Is it possible to access a list of those colors, ordered by community?

I have some code (see below) that takes a large graph and recursively coarse-grains it by modular community structure. Each step takes a graph as input, detects its communities, coarse-grains the ...
user avatar
4 votes
1 answer
89 views

How to get a plane drawing according to the rotation system given

A rotation system is an ordering of neighbours around each vertex that defines a particular embedding of the graph in the plane. For example, below is the rotation system of a plane graph. ...
user avatar
  • 1,069
3 votes
1 answer
56 views

GraphDiameter for molecule graphs error [closed]

I was looking into GraphDiameter for molecules and ended up on this [page][1], which gives examples in various modalities to calculate the graph diameter for this molecule.'CC(C)C(C(=O)NC(=O)C1CCCN1C(=...
user avatar
  • 545
2 votes
1 answer
49 views

IGFaces gives weird result

I'm using the IGraph/M package to perform some calculations on graphs. Specifically, I want to use IGFaces to determine how many edges/vertices each face has for ...
user avatar
7 votes
3 answers
408 views

How to detect chains (sequence of degree 2 vertices ) in a graph?

I am interested in finding the positions of "chains" (sequences of vertex degree 2 vertices) in a graph. I plan on collapsing these chains later to vertices with labels indicating that they ...
user avatar
7 votes
3 answers
597 views

How can I quickly find the coordinates of key points? [closed]

There are 1000 points in the space. The coordinates are (0,0,0) - (9,9,9). Any point can cover all points on the three straight lines (parallel to the X, Y and Z axes respectively) where this point is ...
user avatar
  • 301
-2 votes
2 answers
194 views

Random graphs in Poincare disk

The question is inspired by that article ( see Wiki as a first reading on the topic). This is an actual topic of modern mathematical physics. Here is my (partly successful) attempt to implement such ...
user avatar
  • 17.6k
2 votes
1 answer
86 views

Retrieve flows for a given maximum bipartite graph matching

I have a graph and we can use FindMaximumFlow to find the maximum amount of pairings in such a graph. But I want to know the actual paths as well, not just the maximum amount of them. For instance: ...
user avatar
4 votes
1 answer
117 views

Wish more readable information from IsomorphicGraphQ

In graph theory, an isomorphism of graphs $G$ and $H$ is a bijection between the vertex sets of $G$ and $H$ ${\displaystyle f\colon V(G)\to V(H)}$ such that any two vertices $u$ and $v$ of $G$ are ...
user avatar
  • 1,069
-1 votes
1 answer
66 views

Help with equation within adjacency matrix

(Value R seen within desired matrix equation) resistance = 0.5; (L = ???) identitymat = IdentityMatrix[30]; fullmatrix = ((AdjacencyMatrix[plot])) + identitymat // MatrixForm p.s. I believe I have ...
user avatar
2 votes
2 answers
103 views

Calculating Information centrality for complex network

I want to add the information centrality metric to my analysis of complex network. Is there any in built function or library that I can use in mathematical. I did not come across any algorithm with ...
user avatar
1 vote
1 answer
72 views

Why does Mathematica compute zero centrality scores for these weighted adjacency matrices?

The adjacency matrix with weights on each edges are as shown below. ...
user avatar
0 votes
0 answers
40 views

Stray points plotted when using HighlightGraph to visualize DegreeCentrality

When I use HighlightGraph to visualize the directed edges of a digraph and its DegreeCentrality, stray points are plotted which ...
user avatar
  • 5,171
4 votes
2 answers
178 views

How to check if points lie within a circle

So we have two graphs overlapping with the Show[] function, one is a network of connected points, and the other displays three circles over the top of the points. I'm trying to check which points lie ...
user avatar

1
2 3 4 5
40