Skip to main content

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
1 vote
1 answer
77 views

Make a loop while graph is not empty

I'm new to Mathematica and I'm attempting to write an approximation algorithm to compute "maximum" independent sets. What I need to do is given a graph g ...
Leonardo Lovera's user avatar
0 votes
0 answers
41 views

Removing a vertex and all its neighbors in a graph

I'm implementing an approximation algorithm to compute "maximum" independent sets. It requires that I remove a minimum degree vertex and all its neighbors. I can find the vertex of minimum ...
Leonardo Lovera's user avatar
3 votes
1 answer
59 views

What does the betweenness centrality value of a vertex generated by Mathematica actually mean?

Suppose I have a vertex A in a directed graph. Suppose Mathematica computes its betweenness centrality is 29000.3. What does 29000.3 actually represent? Does it mean 29000.3 times vertex A is on all ...
user42700's user avatar
  • 1,673
0 votes
0 answers
42 views

Harmonious labeling of a graphs

is harmonic labeling possible in Mathematica? then how to find all possible harmonic labelings on a graph using Mathematica
Gisyaa_9's user avatar
0 votes
1 answer
110 views

Hanoi graph in Mathematica [closed]

Is hanoi graph available in Mathematica program? if so, can you show me the code while if not, can we input or build the hanoi graph?
Gisyaa_9's user avatar
3 votes
2 answers
153 views

How can I find all equivalent swapping of some edges in a graph?

This is related to electrical networks, so let me explain a bit about it first. Assume that I have a branch or a loop consisting of only voltage sources in series, as shown below. We know that if we ...
internet's user avatar
  • 547
1 vote
0 answers
67 views

Find criteria if a graph is not perfect

A graph is perfect if the clique number and the chromatic number is the same for every induced subgraph of the graph. A polynomial-time algorithm exists for determining if a graph is perfect. ...
licheng's user avatar
  • 2,049
5 votes
2 answers
120 views

Is this graph planar?

The PlanarGraph command displays graphs using a planar embedding if possible. Thus, quite expectingly ...
yarchik's user avatar
  • 19.1k
3 votes
2 answers
410 views

Grids for FindShortestPath

how to create a program that produces a screenshot-like effect?
ABCDEMMM's user avatar
  • 1,856
3 votes
2 answers
143 views

How to specify the position of Arrowhead in Graph's EdgeShapeFunction?

I have a graph defined as follows: Graph[ ..., EdgeShapeFunction->{(_\[DirectedEdge]_)->{"FilledArrow","ArrowSize"->0.02}} ] I ...
user13892's user avatar
  • 9,483
0 votes
1 answer
83 views

Weighted Graphs

Can the centrality measures in Mathematica (e.g., degree, betweenness, edge betweenness) be adjusted for weight on the edges, where weights represent the volume of an item (say, in Kg)? This would be ...
user42700's user avatar
  • 1,673
1 vote
0 answers
37 views

How can I make length and width of this edge label scale with the graph? [duplicate]

How can I make length and width of this edge label scale with the graph? ...
internet's user avatar
  • 547
3 votes
1 answer
117 views

MorphologicalGraph returning different graphs for visually indistinguishable images

I am using MorphologicalGraph on two images, which are visually indistinguishable, but the resulting graphs are different. ...
csn899's user avatar
  • 4,341
5 votes
3 answers
341 views

How to obtain the list of outermost graph nodes

For the following image: The attached code produces a graph. ...
csn899's user avatar
  • 4,341
2 votes
2 answers
109 views

How to list all vertex of a one-cycle graph in order (cw or ccw)?

Assuming I have a graph with a single cycle below, I want to list the vertices of this cycle in order. Whether it's clockwise (CW) or counterclockwise (CCW) is okay, as long as we are consistent. So ...
internet's user avatar
  • 547
1 vote
1 answer
88 views

Connected-component labeling in Mathematica? [closed]

I needed an implementation of the well-known one-pass connected-component labeling algorithm, see https://en.wikipedia.org/wiki/Connected-component_labeling and I have programmed it myself according ...
Dmitry Garanin's user avatar
5 votes
2 answers
181 views

How to find fundamental cycles in a multiple edge graph?

I tried to find the fundamental cycles of a multiple edge graph below, but it doesn't seem to work. Is it true that the built-in function FindFundamentalCycles does not work with multiple edge graphs? ...
internet's user avatar
  • 547
2 votes
1 answer
77 views

Removing `circular rules'

Say that I have a huge list (>300.000 elements) of polynomial equations and I want to simplify these by looking for some simple equations of the form x[i] == _ ...
Gert's user avatar
  • 1,580
2 votes
0 answers
49 views

Tree edge label visibility and legibility

I am building some tools to help me visualize fitting of generic n-dimensional nonlinear model. I have the data and results stored in a nested association. I've written a few functions to generate a <...
Tapiocaweasel's user avatar
1 vote
6 answers
264 views

How can I find all the different ways to group integer numbers from 1 to 10 into 3 lists?

(Unfortunately, I couldn't change the bounty message. By n above I meant the number of sublists.) How can I group a list of integers from 1 to 10 into 3 sublists of ...
internet's user avatar
  • 547
0 votes
0 answers
25 views

How to generate a graph and label all vertices with eccentricity of each vertex and then count the edges of generated graph with same end vertices? [duplicate]

I want to generate a graph. Add degree of neighborhood vertex. and count the edges of edges with same end vertices of the graph.
Nadeem Awan's user avatar
0 votes
0 answers
18 views

How we can find neighborhood degree sum vertices and find count edges of same end vertices? [duplicate]

I am new in Mathematica. I want to draw a graph then add the degree of neighborhood vertices and generate a graph with neighborhood vertices sum degree. At next step I want to count edges of ...
Nadeem Awan's user avatar
3 votes
2 answers
126 views

Output of IsomorphicGraphQ

Is it same for newer versions of Mathematica that IsomorphicGraphQ has problems with multiple self-connected edges? ...
azerbajdzan's user avatar
  • 19.7k
3 votes
0 answers
58 views

Graph with non-integer vertices

Why the following works only with integers and if other names of vertices are used UndirectedEdge is needed? ...
azerbajdzan's user avatar
  • 19.7k
1 vote
1 answer
292 views

How to solve and output the coloring problem in permutations and combinations?

Apply the four different colors red, yellow, green, and black to the areas in the figure shown below, with the requirement that adjacent areas cannot have the same color. How many different coloring ...
csn899's user avatar
  • 4,341
1 vote
1 answer
74 views

How to partition graph on vertex degree. And count the number of edges with same end vertices? [closed]

Step-I Input a graph and generate Table How to partition graph on vertex degree. And count the number of edges with same end vertices as given in table given below. The program also shows the graph ...
Nadeem Awan's user avatar
0 votes
0 answers
38 views

How to select graphs with specific vertex conditions?

I'm trying to select graphs that have a path with the following conditions: Include vertices a1, a2, b1, b2. Vertices a1 and <...
internet's user avatar
  • 547
3 votes
1 answer
41 views

How to Replace EdgeLabel in a Graph [duplicate]

I am working with Graphs in which I want to define a Graph with Symbols or Strings as EdgeLabels, and later replace these with functions of the symbols with symbols then replaced with numerical values....
David Keith's user avatar
  • 4,604
3 votes
1 answer
79 views

How to control Graph layout direction

I want to construct signal flow graphs using Mathematica. Below is a simple example. It works well enough except that it draws from right to left. In fact it seems to choose left to right or right to ...
David Keith's user avatar
  • 4,604
4 votes
1 answer
74 views

EdgeLabels and EdgeLabelStyle of Graph

I try to name edges according to the nodes emerging from them and entering them. Each edge takes a specific name $e_{ij}$. The following example illustrates what is required ...
Emad kareem's user avatar
1 vote
1 answer
85 views

How to plot a community structure with specific properties

This code generates a community structure where each community is shown with a different color. The same color is used for bars within a community and outgoing edges from that community. I would like ...
Tugrul Temel's user avatar
  • 6,233
5 votes
1 answer
86 views

How can I control curved edges between vertices?

I want to create graphs consisting of many nodes arranged in a line. The nodes have values (which determine their size) and should be arranged in increasing order. A simple example is something like ...
towerglove's user avatar
5 votes
1 answer
150 views

How can I remove the exterior face in PlanarFaceList?

For one of the embedding of a planar graph, only one face is the exterior face which contain the point. In the example as below, the ...
herbertfederer's user avatar
1 vote
2 answers
118 views

How to determine if two colorings of a graph are the same?

A coloring of a graph $G$ with vertex set $V$ is the partitioning of $V$ into so-called color classes so that no two vertices of the same class are adjacent. A $k$-coloring contains exactly $k$ color ...
licheng's user avatar
  • 2,049
3 votes
2 answers
195 views

How to remove non-loop vertices in a graph?

How can I remove vertices from a graph that do not form a loop? For example, ...
internet's user avatar
  • 547
0 votes
0 answers
71 views

All BFS/DFS trees starting from a single vertex

Let $G$ be a simple graph. A spanning tree of $G$ is a subgraph of $G$ that is a tree containing every vertex of $G$. A spanning tree can be built by doing a breadth-first search or a depth-first ...
licheng's user avatar
  • 2,049
1 vote
1 answer
71 views

How to obtain positions of graphs satisfying certain conditions?

I first generate some random graphs, and then the following code can filter graphs with maximum degree 8. ...
licheng's user avatar
  • 2,049
1 vote
0 answers
59 views

A cryptic message when converting a Graph to Graphics

In Mathematica 13.3 (Windows 11) I do Graph[{1, 2}, 1 \[UndirectedEdge] 2] then right-click on the result and choose "Convert To Graphics" from the menu ...
მამუკა ჯიბლაძე's user avatar
1 vote
0 answers
99 views

How to speed up data stream (with graph6 format) reading?

I attempt to filter connected graphs with 8 vertices, 14 edges, and matching number three using the 'geng' tool and IGraphM. First way: ...
licheng's user avatar
  • 2,049
1 vote
1 answer
149 views

How can a directed network model be linked to Dataset[ ] for further computation?

REVISED Question: My only request is to know how to monitor the evolution of {agentStates, steps} in simulateSlow[...] function. ...
Tugrul Temel's user avatar
  • 6,233
2 votes
0 answers
84 views

Why are WeightedAdjacencyMatrix and WeightedAdjacencyGraph inconsistent?

I have a weighted adjacent matrix of a graph: ...
licheng's user avatar
  • 2,049
2 votes
0 answers
75 views

How to get the optimal arrangement minimizing depth and maximizing level usage for a dependency tree graph?

Given a graph like as follows: ...
user13892's user avatar
  • 9,483
3 votes
1 answer
160 views

How do I find all the nets of a polyhedron?

The following will show me a single example net of a polyhedron PolyhedronData["Dodecahedron", "Net"] And ...
Peter Olson's user avatar
2 votes
2 answers
75 views

Graph with fixed vertex layout but curved edges

I have constructed a graph (network) whose vertices I want to be arranged in a square grid, I have already done this by means of the "GridEmbedding" GraphLayout, however this layout makes ...
Juan Felipe Salamanca Lozano's user avatar
1 vote
0 answers
57 views

Convert a graph to Lad format using a concise method

The LAD format is a kind of graph formats; see https://perso.liris.cnrs.fr/christine.solnon/SIP.html The specific format requirements are as follows: Each graph is described in a text file. If the ...
licheng's user avatar
  • 2,049
1 vote
0 answers
154 views

How to construct a layered 3D graph of three community structures?

Consider: ...
Tugrul Temel's user avatar
  • 6,233
2 votes
1 answer
161 views

How to implement the formula for the number of undirected $k$-cycles in a graph $G$?

This Wolfram MathWorld page said that, Giscard et al. "A General Purpose Algorithm for Counting Simple Cycles and Simple Paths of Any Length." 16 Dec 2016. gave the formula for the number of ...
138 Aspen's user avatar
  • 1,541
3 votes
0 answers
93 views

Drawing the Graph of a complex chemical reaction network

I'm interested in how Mathematica or IGraph/M package can help with the visualization of complex chemical reaction mechanisms applied in fields like combustion, biochemistry, water radiolysis, or ...
Javier J Navarro's user avatar
2 votes
1 answer
132 views

How can I determine the cycle lengths in a directed graph?

I have a directed graph: a = {{0, 1, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 1}, {1, 0, 0, 0}}; AdjacencyGraph[a] I want to determine the cycle lengths in the directed ...
geoffrey's user avatar
  • 867
1 vote
0 answers
58 views

Why is GraphPropertyDistribution[.] taking an infinite amount of time to run?

This code is from the documentation: ...
Tugrul Temel's user avatar
  • 6,233

1
2 3 4 5
44