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
6 votes
3 answers
540 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
  • 97
-3 votes
1 answer
86 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
  • 16.5k
2 votes
1 answer
66 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
98 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
  • 569
0 votes
1 answer
58 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
99 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
68 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
37 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,172
3 votes
2 answers
163 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
2 votes
1 answer
100 views

How to draw a cycle graph of a group?

MMA can plot a Cayley graph by CayleyGraph directly, which can help us to visualize the group: ...
user avatar
  • 23k
3 votes
3 answers
89 views

How to Derive the Edge List From Adjacency Matrix with Given Row/Col Headers

I've written the following code. It correctly is deriving the edge list from the matrix but it is by row # and col # instead of row name and column name. My questions are (1) how can I add the row and ...
user avatar
  • 1,039
2 votes
2 answers
107 views

Animated contour plots inside multiple shapes

I am new to Mathematica and have recently been trying to investigate solar weather on power grids. I have managed to plot the power grid being studied where the vertices are substations and would like ...
user avatar
1 vote
0 answers
37 views

Comparing task completion using Graphs and Adjacency Matrices

I would like to compare sequences of tasks completed using Graph and AdjacencyMatrix. I have included an MWE for the readers' ...
user avatar
  • 5,172
1 vote
1 answer
69 views

Selecting edges for a random geometric graph in an arbitrarily shaped domain

I have some code to generate a random geometric graph in a domain of specificed shape (here an H-shape). Edges cannot exist when they intersect the domain boundary (so we need line of sight for edges ...
user avatar
  • 1,505
0 votes
1 answer
46 views

How to plot a set-valued mapping graph

I know that if $T$ is a single-valued mapping for example $T(x)=x^{2}$ for all $x\in[0,1]$ then its graph can be plot using Plot[x^2, {x, 0, 1}] Is there any way ...
user avatar
  • 169
0 votes
1 answer
45 views

Converting Combinatorica graph to standard graph type

I'm trying to count triangles in random d-regular graphs. Combinatorica has a function RegularGraph, which gives me the random graph and IGraphM has a function <...
user avatar
  • 11
2 votes
0 answers
119 views

How to calculate the path covering number of a graph?

The path covering number of a graph $G$ is the minimum number of vertex-disjoint paths that cover the vertices of $G$. I am searching for a mathematica package that can calculate path covering number ...
user avatar
  • 569
9 votes
3 answers
329 views

How do you get a whole, outward spitting curved edge in graph?

I don't very like the straight edge like ...
user avatar
  • 23k
6 votes
1 answer
70 views

How to hightlight CayleyGraph?

...
user avatar
  • 23k
4 votes
2 answers
182 views

Speeding up the Kuramoto model on a random graph

I am solving the Kuramoto model on a random graph $G(n,p)$, plotting the synchrony against the coupling parameter, as follows, ...
user avatar
  • 1,505
0 votes
1 answer
83 views

How to Compute the All Pairs Shortest Paths: Betweenness Centrality of an Edge e [closed]

By definition, betweenness centrality of an edge e is the sum of the fraction of all-pairs shortest paths that pass through edge e. Traditionally, a(s,t) is the number of shortest (s,t)-paths and a(s,...
user avatar
  • 1,039
9 votes
1 answer
234 views

Solving Hashi in graph theory

Today's (April 3, 2022) New York Times magazine has a new class of puzzle, HASHI, by Prasanna Seshadri: "Connect the islands (the circles with numbers) with as many bridges as specified by the ...
user avatar
3 votes
0 answers
136 views

Is it possible to define substitution rules on edges instead of nodes [Wolfram Physics]?

I have a small question about the way substitutions work in the Wolfram Physics project, which might be a general question about how to add edges between nodes and edges. Running a Wolfram Physics ...
user avatar
  • 1,303
5 votes
2 answers
172 views

How can I get Scaled within Inset to overlay Rectangle correctly?

Consider the following graph: ...
user avatar
  • 4,677
15 votes
5 answers
2k views

List all homeomorphically distinct irreducible connected simple acyclic graphs of size 10 ("Good Will Hunting" problem)

In the movie Good Will Hunting the opening math problem is: Display all homeomorphically distinct irreducible connected simple acyclic graphs (trees) of size $n =10$ Recall that a tree (acyclic ...
user avatar
0 votes
0 answers
37 views

Spanning Subgraphs of random sizes with probabilities on edges

I need a way of taking some graph G and obtaining a spanning subset of G where each edge $e_i$ has some probability $P_i$ of being in the subgraph. So the size of the edge sets of each random subgraph ...
user avatar
2 votes
0 answers
30 views

Count all embeddings of a geometric graph on the unit square that preserve all angles between existing edges

If I have a geometric graph with $n$ vertices in the unit square, is it possible to count all embeddings of the graph on the unit square that preserve angles between the existing edges? It would ...
user avatar
  • 1,505
3 votes
2 answers
62 views

Specifying Graph Edges Should Not Overlap Vertices

In the options for GraphPlot and related functions, it seems EdgeShapeFunction overwrites a ...
user avatar
2 votes
1 answer
49 views

VertexLabels not inherited by edges?

I'd like to custom name the vertices of a (complete) graph and have those names reflected in the edges. shiftGraph produces a complete graph with vertices labels from imin to imax. ...
user avatar
  • 339
2 votes
0 answers
50 views

Reproducing Graph functionality from Combinatorica using GraphData (ListGraphs, NumberOfGraphs)

I want to generate graphs with n vertices and e edges, and I also want the ability to count the number of non-isomorphic graphs ...
user avatar
  • 558
1 vote
1 answer
68 views

Path of Least Resistance Minimization Problem

I'm trying to find a path of least resistance using a matrix c of resistance and a given exogenous vector kOne of the total least resistance from point(n) to point(4) (the destination): ...
user avatar
1 vote
0 answers
38 views

Enumerating labeled graphs on n vertices

I'm trying to enumerate the labeled graphs on $n$ vertices having at most $e$ edges. I thought GraphData /@ GraphData[n] and then filtering by edge count would do ...
user avatar
  • 11
9 votes
3 answers
643 views

Faster determination if two nodes are connected in a graph

In the code below connectedQ[g_,v1_,v2_] is a function to check if two nodes v1 and v2 in ...
user avatar
  • 1,656
4 votes
2 answers
344 views

Generate a Multicolor Figure Eight with Numbered Circles and Text

Is it possible to draw the following figure in MMA, where I can change the text? We can plot the figure eight as a lemniscate using ...
user avatar
  • 2,036
2 votes
2 answers
77 views

Why VertexCoordinate does not work here?

First I plotted this and got a nice graph. ...
user avatar
  • 1,656
0 votes
1 answer
95 views

Visualization of citation network [closed]

I am new to mathematica, I want to visualize the citation network using some data, could anyone suggest me which function should I use to visualize the citation network like the following.
user avatar
2 votes
2 answers
257 views

Building a distance matrix

I came across an interesting exercise that I would like to try to solve with Mathematica to improve my skills. In data is provided to build a distance matrix. The data looks like this, starting from <...
user avatar
  • 45
1 vote
1 answer
54 views

How could I do make both vertices and edges in a graph moveable?

How could I make both vertices and edges moveable like this. (source: https://csacademy.com/app/graph_editor/) (In the image only nodes are movable but I would like to do this for edges as well) <...
user avatar
  • 1,656
1 vote
1 answer
60 views

How can I check if some specific cycles are in a graph?

How can I check if some specific cycles are in a graph? ...
user avatar
  • 1,656
0 votes
0 answers
22 views

Failing to import a TGF file of a graph with no edges (V12.x and V13.0)

Version: 12.x and 13.0 I am having an issue with importing a graph stored in the Trivial Graph Format (TGF) when the graph has no edges. Consider the following: ...
user avatar
1 vote
1 answer
135 views

Brute force graph transformations

I have a list of list of pairs of integer that for me represents a list of graphs with n nodes. For example with n=5 I could ...
user avatar
3 votes
2 answers
200 views

Skeletonizing an image

I'm trying to skeletonize an image (ref) img = Import["https://i.stack.imgur.com/q2xUi.png"] graph= MorphologicalGraph[img] Input image: Skeleton ...
user avatar
  • 307
1 vote
0 answers
51 views

Accuracy issue in computing a Markov Transition Matrix

this question is based on a previous post of mine. I am simulating a one-dimensional Markov process on a linear graph. Transition probabilities are different than zero only for nearest neighbours of ...
user avatar
2 votes
1 answer
88 views

How to Apply Hierarchical Edge Bundling in a Very Large Graph

I have a directed graph consisting of 1616 vertices and an edge count = 3315. I'm trying to plot this by the code... ...
user avatar
  • 1,039
2 votes
1 answer
121 views

Generating a network from an image

This is a follow up to my previous question here I have to skeletonize an image (ref) and convert the skeleton into a network. I've tried the following ...
user avatar
  • 307
0 votes
0 answers
80 views

How were the graphs in the documentation directly entered?

So I was reading the documentation on the FindPostmanTour function and in several places I see graphs being directly shown without any obvious method by which they were constructed, leading me to ...
user avatar
  • 187
1 vote
0 answers
76 views

Skeletonize an image

I'm trying to skeletonize an image (ref) bin = Import["binary.png"] skeleton = Pruning[Pruning@Thinning[bin], 15] Input binary image: Skeleton generated:...
user avatar
  • 307
2 votes
1 answer
104 views

How do i plot a graph for width vs height of the slits from an image

I need to calculate the width of the slits along the length of each slits. I am new to image processing in mathematica and I need to plot a graph showing how the width changes along the length. I have ...
user avatar
  • 21
4 votes
1 answer
118 views

Visualizing transitive reduction of the Hasse Diagram of the integer subset lattice

I have a list of sets of integers, forming semi-lattice under inclusion relation. I need to visualize transitive reduction of the semi-lattice's Hasse Diagram. What is a good way to do this in ...
user avatar
2 votes
1 answer
146 views

Find the Schnyder 3-orientation of a plane triangulation graph

In 1990, Schnyder proved that the internal edges of a plane triangulation graph can be oriented such that each internal vertex has exactly three outgoing edges and the vertices of the outer face have ...
user avatar
  • 569

1
2 3 4 5
39