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
0 votes
0 answers
74 views

Why does the string "\" prevent a graph6 string conversion to a graph?

I input the graph6 string ...
licheng's user avatar
  • 2,029
3 votes
4 answers
353 views

How to use Callout in a directed graph with circular embedding?

Given the following code: ...
Tugrul Temel's user avatar
  • 6,203
5 votes
3 answers
373 views

En route to Mobile (driving distances)

I want to find a nice way to display driving distances, but got stuck with the following problem: 1. Example data ...
eldo's user avatar
  • 69.4k
2 votes
1 answer
141 views

How to map community structure with circular embedding and normalized edge weights?

Given: ...
Tugrul Temel's user avatar
  • 6,203
2 votes
0 answers
65 views

"RegularHyperbolicTilingGraph" Does Not Work Properly [closed]

I am trying to draw regular hyperbolic tesselations using the "RegularHyperbolicTilingGraph" function on Mathematica 13. Here is the introduction of this function on the repository: https://...
Tianyi Wang's user avatar
0 votes
0 answers
71 views

Find all the cycle in a graph including the one with vertex repetition

I have a simple graph given by ...
Dario Bercioux's user avatar
3 votes
1 answer
60 views

Discrepancy between `IGEigenvectorCentrality` and `EigenvectorCentrality` in Mathematica

I've been experimenting with directed graphs in Mathematica and I'm having some difficulty understanding the differences between IGEigenvectorCentrality and ...
cconsta1's user avatar
  • 155
0 votes
0 answers
65 views

Unusual behaviors of PlanarFaceList

To describe this question clearly, we have to provide some strict definitions regarding planar (plane) graphs. First, we consider connected graphs. A plane graph is a particular drawing of a planar ...
licheng's user avatar
  • 2,029
0 votes
0 answers
57 views

Comparing graphs in mathematica: shape vs. name

I'm trying to identify and remove duplicate graphs when contracting vertices. To illustrate this, I'll start with two simple graphs where I'm trying to create a function that can recognize them as ...
hana's user avatar
  • 2,390
2 votes
1 answer
149 views

How can one convert between mtx format and graph format?

There are various variants of graph coloring, such as when I want to compute the star chromatic number of a graph, Mathematica seems not to provide relevant functions. Fortunately, the software ...
licheng's user avatar
  • 2,029
5 votes
1 answer
84 views

Find a maximum $k$-colorable subgraph

For a given graph, the Maximum $k$-Colorable Subgraph Problem is the problem of determining the largest set of vertices of the graph that can be colored using $k$ distinct colors such that adjacent ...
licheng's user avatar
  • 2,029
1 vote
1 answer
76 views

Coloring a graph with only 2 colors (less than VertexChromaticNumber) with Violations Accepted

Consider a graph which is as shown below. ...
Anjan Kumar's user avatar
  • 4,979
1 vote
1 answer
71 views

How to represent a digraph in a 2D circle structure using NeighborhoodGraph[.]

This code works and delivers NeighborhooGraph[.] of a chosen vertex. The resulting graph is bit difficult to understand and therefore I like represent the same ...
Tugrul Temel's user avatar
  • 6,203
1 vote
0 answers
59 views

Calculating betweenness centrality using two or more edge weights?

I recently became interested in complexity science through a project I'm working on, so I wondered whether one could calculate the Betweenness Centrality using two or more edge weights concurrently. I ...
cconsta1's user avatar
  • 155
1 vote
3 answers
84 views

Labeling point coordinates in path graph using VertexLabels

Question: How do we label point coordinates in Pathgraph using VertexLabels. Suppose we have a list of points ...
Arbuja's user avatar
  • 71
4 votes
0 answers
207 views

Defining a "pathway" from a list of points

1. Description of Pathway 1.1 Preliminary Definitions Let $A=[-2,2]^2$, where $\text{Area}(A)=16$ and $\lceil \cdot\rceil$ is the ceiling function. For $\varepsilon\in\mathbb{R}$, let $\left\{U_i\...
Arbuja's user avatar
  • 71
6 votes
1 answer
135 views

Refining LayeredGraphPlot by selecting downward links only

This codes: ...
Tugrul Temel's user avatar
  • 6,203
1 vote
0 answers
34 views

Center Vertex of a StarEmbedding

How is the center vertex of a StarEmbedding determined? It may be the vertex with the maximum betweenness but the docs are silent on the details of the StarEmbedding layout algorithm.
user90346's user avatar
  • 355
0 votes
1 answer
127 views

How to generate a bubble chart of a directed graph with several properties using Manipulate[.]

This code: ...
Tugrul Temel's user avatar
  • 6,203
4 votes
2 answers
226 views

How to find the most influential paths in a weighted, directed graph

Given a weighted, directed graph, I want to find the most influential paths (a combination of large weights). I reverse the usual shortest path problem because the context I am trying to model defines ...
Tugrul Temel's user avatar
  • 6,203
5 votes
7 answers
260 views

Most common sublist occurance in a list of lists

I have a list of lists, {{a,b,c},{d,e,f},{a,b,f},{a,b,z,}...} Can I find sublists that occur very frequently in each list? For example, in this case, ...
apg's user avatar
  • 2,135
1 vote
1 answer
136 views

How can one call multiple executable files of Nauty?

We know that Mathematica can call the "geng" function from Nauty. I have seen several examples of this on this forum. For example, (in windows), ...
licheng's user avatar
  • 2,029
0 votes
0 answers
64 views

Find all separating sets of a graph

Let $G$ be a connected graph. A subset $S$ of $V(G)$ separates $G$, if the graph $G-S$ obtained from $G$ by deleting the vertices of $S$ is disconnected. The original motivation was to find the ...
licheng's user avatar
  • 2,029
3 votes
1 answer
69 views

NetGraph won't accept EmbeddingLayers of different n

Why doesn't this work: ...
user233932's user avatar
0 votes
0 answers
38 views

Max graph limit change mathematica [duplicate]

I have a huge graph in Mathematica, and I want to display it. The only problem is that it stores itself as a "graph" object rather than displaying the edges and vertices. Is there any way to ...
Navvye's user avatar
  • 151
2 votes
0 answers
95 views

Does VertexChromaticNumber return the optimal value?

The following code is meant to make a graph where each node represents a bitstring of length d and two nodes are connected if and only if the Hamming distance between their bitstrings is exactly 2. It ...
Simd's user avatar
  • 1,119
0 votes
0 answers
62 views

Implementing Strahler Stream Order in Mathematica

I want to implement the Strahler stream order in Mathematica. I've found some SQL code for it online. And this is the code that I've written so far ...
Navvye's user avatar
  • 151
2 votes
0 answers
46 views

How to find the "widest" path between two nodes in a given graph (via built-in functions)?

The resource function ResourceFunction["FindLongestPath"] can be used to solve the longest path problem, but Wikipedia also has an article on the so-...
user688486's user avatar
1 vote
1 answer
60 views

Spacing in Graph using LayeredDigraphEmbedding

I currently use the following code to obtain the graph as shown. How can I change the horizontal spacing between vertices to eliminate overlap? Changing VertexSize does not help, nor does AspectRatio ...
cadeFoster's user avatar
3 votes
1 answer
127 views

How plot the 3d Cayley graph of $F_3$?

Im new to mathematica and I would like to do the Cayley graph of a free group of three generators $F(a,b,c)$, such like this
Zaratustra's user avatar
5 votes
3 answers
295 views

Solving the Covering Salesman Problem in Mathematica

Say I have a weighted graph ...
Tomi's user avatar
  • 4,366
1 vote
0 answers
94 views

How to find BetweennessCentrality[...] for binary edges rather than vertices?

I have the following directed graph g and can find BetweennessCentrality[g] for vertices. ...
Tugrul Temel's user avatar
  • 6,203
1 vote
1 answer
95 views

How to color the vertices of a graph so no adjacent vertices have the same color?

How can I color the vertices of a graph so that no pair of adjacent vertices share the same color? The function FindVertexColoring can be used for this.
Peter Burbery's user avatar
2 votes
1 answer
93 views

How to style a graph of isotope decay data automatically so that vertices and edges correspond to half-lives and decay probabilities?

For teaching purposes I am trying to create some plots of radioactive decay chains, whereby each node on the graph represents the isotope with a color corresponding to the isotopes stability and with ...
Dunlop's user avatar
  • 4,023
0 votes
0 answers
62 views

Plot Color Discontinuous with Legend

Im working on a project that simulates the temperature distribution within a material. Right now I have multiple plots using the ColorFunction -> "TemperatureMap" and a legend on the side....
Adam's user avatar
  • 11
5 votes
0 answers
207 views

How to calculate the circumference of a graph?

The circumference of a graph is the length of any longest cycle in the graph. I couldn't find a specific command to calculate the circumference of a graph or find a longest cycles. Using ...
licheng's user avatar
  • 2,029
3 votes
1 answer
59 views

Controlling spacing between two After positions

I am working with a graph with VertexLabels determined as follows: ...
ExpressionCoder's user avatar
4 votes
4 answers
338 views

How to Build EdgeList from a List

I've written code to build an EdgeList where each element in the list is a node pair set. For example, given the list with the set of 5 node pairs below, the code correctly produces the undirected ...
user42700's user avatar
  • 1,593
1 vote
1 answer
92 views

How to delete Adjacent Vertices Pairwise from a Graph

I want to delete adjacent vertices in a graph pairwise, i.e, if {a,b} are connected by an edge, I want both a and b to removed such that not only are the vertices themselves removed, but also all the ...
Navvye's user avatar
  • 151
2 votes
1 answer
108 views

Count chains in complete graph

Let's say I have a complete graph like this ...
mclord's user avatar
  • 177
5 votes
1 answer
147 views

Adding Edge and Vertices to already made graph?

I have a notebook that generates a hexagonal grid graph and its vertex connectivity, coordinates, and numbers as an input for an FEA program in matlab. I simply want to add members to this shape (or ...
c.moon's user avatar
  • 51
2 votes
0 answers
104 views

Adjacency matrix from geographics

The following code shows the map of a number of cities in a country having a population between a specified minimum and maximum value. ...
Daniel Rosencat's user avatar
2 votes
1 answer
222 views

Finding induced subgraphs that are also trees

Given a graph $G$ with $n$ vertices, I need to find a subgraph consisting of $m$ vertices $\{v_1,\ldots,v_m\}$, and the induced subgraph of this subgraph should also be a tree. For example, suppose $G$...
Dotman's user avatar
  • 424
1 vote
1 answer
69 views

Additive graphs code

For $n\geq 1$ the fibonacci sum graph on the set $[n]=\{1,2,\ldots,n\}$ denoted by $G_n$, is the graph with vertex set $[n]$ and edge set $\{uv, u+v=F_i, \text{for some}\quad i\}$. I wrote the ...
d.y's user avatar
  • 143
2 votes
1 answer
106 views

Turning Ising partition function into diagrams

This question is about transforming an expression into a diagram. The partition function of the Ising model for a 4×4 square lattice without a magnetic field has the form, or ...
felix's user avatar
  • 291
0 votes
1 answer
46 views

ContourPlot not working [closed]

Im trying to use ContourPlot to plot this function, but it's just giving me a blank graph. What's wrong? My input: ...
Kei Len's user avatar
  • 27
2 votes
0 answers
109 views

Is FindShortestTour really exact? [closed]

I have read online that the FindShortestTour function on Mathematica uses the Concorde TSP solver, which is meant to provide exact solutions. However, I have been playing with this problem on my own, ...
slithy_tove's user avatar
2 votes
0 answers
34 views

Why is a blank auto-magically added to an option value of a function in the WL file of a paclet?

This is an observation I made during the course of writing a Paclet. The following is an example of a function which happens to use a function from the IGraphM package, whose use is affected by the ...
Hans Sieburg's user avatar
9 votes
1 answer
360 views

Generating custom GraphLayout for a hyperbolic graph

I have code that generates a Matrix Mat (Mat = data) that, when the graph is plotted, ...
Shamina's user avatar
  • 633
2 votes
1 answer
40 views

How to Delete Edges Given Specific Vertex Labels?

Given the following directed graph, is there a way to delete all edges that contain a specified vertex label name. For instance, suppose the edge list below was read in. Any edge in that list with a ...
user42700's user avatar
  • 1,593

1
2
3 4 5
44