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
3 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
  • 39.9k
2 votes
1 answer
76 views

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

Given: ...
Tugrul Temel's user avatar
  • 5,251
2 votes
0 answers
51 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
60 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
55 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
55 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
  • 1,807
0 votes
0 answers
50 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,678
2 votes
1 answer
95 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
  • 1,807
5 votes
1 answer
56 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
  • 1,807
1 vote
1 answer
73 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,919
1 vote
1 answer
66 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
  • 5,251
1 vote
0 answers
38 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
70 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
  • 29
4 votes
0 answers
198 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
  • 29
6 votes
1 answer
132 views

Refining LayeredGraphPlot by selecting downward links only

This codes: ...
Tugrul Temel's user avatar
  • 5,251
1 vote
0 answers
33 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
116 views

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

This code: ...
Tugrul Temel's user avatar
  • 5,251
4 votes
2 answers
143 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
  • 5,251
4 votes
6 answers
224 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
  • 1,927
1 vote
1 answer
128 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
  • 1,807
0 votes
0 answers
54 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
  • 1,807
3 votes
1 answer
47 views

NetGraph won't accept EmbeddingLayers of different n

Why doesn't this work: ...
user233932's user avatar
0 votes
0 answers
36 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
  • 19
2 votes
0 answers
85 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,109
0 votes
0 answers
58 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
  • 19
2 votes
0 answers
35 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
52 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
101 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
290 views

Solving the Covering Salesman Problem in Mathematica

Say I have a weighted graph ...
Tomi's user avatar
  • 4,090
1 vote
0 answers
92 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
  • 5,251
1 vote
1 answer
77 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
80 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
  • 3,893
0 votes
0 answers
52 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
172 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
  • 1,807
3 votes
1 answer
59 views

Controlling spacing between two After positions

I am working with a graph with VertexLabels determined as follows: ...
Michel's user avatar
  • 1,596
4 votes
4 answers
268 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,553
1 vote
1 answer
86 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
  • 19
1 vote
1 answer
103 views

Count chains in complete graph

Let's say I have a complete graph like this ...
mclord's user avatar
  • 167
5 votes
1 answer
140 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
1 vote
0 answers
84 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. ...
Dan Cat's user avatar
  • 355
2 votes
1 answer
172 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
  • 376
1 vote
1 answer
65 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
89 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
44 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
105 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
33 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
5 votes
1 answer
289 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
  • 583
2 votes
1 answer
31 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,553
1 vote
0 answers
39 views

Finding an optimal orientation and the oriented diameter of a given graph

I am wanting to specify a graph (a collection of vertices and edges) and find the optimal orientation of that graph. An orientation of an undirected graph is an assignment of a direction to its every ...
Emily's user avatar
  • 11
1 vote
0 answers
75 views

Find all connected undirected graphs with n edges

I want to find the undirected connected graph with all 12 edges, corresponding to https://oeis.org/A002905. I searched for this answer enumerating-all-connected-graphs-with-9-vertices, which can give ...
Aster's user avatar
  • 3,816

1
2 3 4 5
43