Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
3answers
213 views

Vertex Size for more than one vertex

I am pretty sure that the answer to this question is pretty simple, but after googling for several hours in an attempt to find an answer I feel I have to ask someone for help. I just made my first ...
1
vote
0answers
36 views

Sampling pairs of nodes with given distance between them

For the purposes of this question we assume undirected and connected graphs. I am trying to learn how to efficiently find pairs of nodes in a graph that are separated by prescribed distance $d.$ One ...
1
vote
0answers
38 views

Measuring Degree Correlations of Networks

I'm trying to write a program that will measure the degree correlation of the network. The theory is here (page 8). I've written something like this up to now: ...
1
vote
1answer
24 views

Finding the vertex coordinates of a graph

I should know this, but how do I find the values of the vertex coordinates of a graph which is laid out automatically?
0
votes
1answer
43 views

Arrowhead offset

I'm a relatively new to Mathematica and I am currently trying to make a Hasse-Diagram. However, I am struggling to get the arrowheads right: ...
6
votes
1answer
92 views

Graph that visualizes subset relations

First, off I am a bloody beginner when it comes to programming in general and Mathematica in particular. I only started using it so I can make sense of my suggestions for the semantics in my syntax ...
3
votes
2answers
81 views

Create flowsheet-like graph

I'd like to create a graph that resembles a flowsheet in process simulation applications. A concrete example would be this graph: I was able to recreate it by manually specifying the vertex ...
1
vote
1answer
33 views

How can I find EdgeWeights strongly connected components using Manipulate

Given the following Code: ...
1
vote
3answers
81 views

How can I color the elements of the largest strongly connected component in ListPlot

The following Code: ...
2
votes
2answers
69 views

How to overlay MatrixPlot with GridGraph?

I have a Matrixplot and a grid graph and I want to overlay them. But when I use show[g1,g2], it did come out what I wanted. I wonder how can I overlay them and make them like this? To make the points ...
1
vote
1answer
26 views

Show all subgraphs which don't contain a specific subgraph

Is there a way to generate a list of all $m$ subgraphs $g_1,g_2,\dots,g_m$ of a graph $G$ which don't contain a specified graph isomorphic to the graph $H$? For example, all subgraphs of the complete ...
0
votes
0answers
23 views

Problems in understanding the time complexity for a graph [migrated]

I have the following algorithm in a graph G = (V, E). m is the number of edges and n is the number of nodes(vertices). dG'(u) is the number of nodes that are neighbours with u. My problem is that I ...
1
vote
1answer
57 views

How can I count the number of edges between connected components of a directed graph

The following code: ...
3
votes
1answer
78 views

Efficiently computing current flow betweenness centrality for graphs

Definitions: Given a graph $G=(V,E),$ the current flow betweenness is a node-wise measure that captures the fraction of current through a given node with a unit source (s) sink (t) supply $b_{st}$ (1 ...
1
vote
1answer
84 views

How can I generate a histogram for the largest strongly connected component of a directed graph?

With the help of several persons from this forum, I have written the following MMA Code using Manipulate to describe certain ...
5
votes
2answers
123 views

How to List the Set of In-links to a Node

Suppose I have the edges set below. From this, can a list of all nodes that in-link to all other nodes be generated? For example, 17 nodes link into node 5 (i.e., 17 nodes point to node 5 as a ...
4
votes
1answer
82 views

Ideas for styling graph nodes with weights

Suppose we have the following random graph SeedRandom[100] n = 15; m = 20; G = RandomGraph[{n, m}, VertexLabels -> "Name"]; and a list of weights for the ...
0
votes
0answers
19 views

The problem in finding a connected path through square lattice

I have a LxL square lattice. I randomly chose some points on this lattice and take them as my points. I want to find a connected path from left(0) to right(L). Below is my code: ...
1
vote
1answer
47 views

how to conduct mathematical operations using numerical characteristics attached to vertices

Given a directed graph g: ...
3
votes
1answer
68 views

How do I color edges on a graph using a pattern?

I have the following code, an attempt to color the even branches of a tree... but it’s not working correctly: ...
4
votes
4answers
121 views

how to make tree plot to 100 rows

[ I know how to make finite tree plot(small row numbers), but how can I make this thing continue to 100 rows? Thank you very much!!
1
vote
1answer
31 views

Changing Vertex Color and Coordinates From a list or vertex

I'm making a visualisation of an email network of a company. Each vertex represents a person and vertex color represents their position(BOD,CEO,manager,leader). The edges' Thickness according to ...
2
votes
1answer
81 views

EdgeStyle in GraphPlot

I am trying to change the thickness of each edge according to its weight using GraphPlot but it doesnt seem to work. ...
2
votes
0answers
33 views

Generating a directed graph from a map of flows

I have generated a stream plot, with curves on it using the following code: ...
1
vote
0answers
59 views

Two graph specifications that I expect to produce identical graphs don't [closed]

I would like to add up the following two seemingly identical graphs, but it seems they are different. I can't figure out what is the difference between them and how to make them really identical <...
0
votes
0answers
37 views

An Elementary Introduction - Problem 22.13 VertexLabels [duplicate]

Problem 22.13 Make raster images of the letters of the alphabet at size 20, then make a graph of the 2 nearest neighbors of each one. My solution ...
1
vote
0answers
64 views

Graph of a list of rules with coefficient

I am trying to transform an expression to a list of rules and after that plot its graph. The expression has the following form ...
1
vote
1answer
83 views

How to construct a specific binary tree from a particular set of information?

I run a algorithm to solve a problem that return a set of information relative to a binary tree associated with these problem. For illustrate the results obtained I try to plot the binary tree. I make ...
4
votes
1answer
82 views

Algorithmic graph embedding (layout) based on the values of adjacent vertices

I would like to embed (layout) a tree graph where the angle of each edge is determined by a simple function of the values of the vertices that that edge joins as well as the previous edge angle. An ...
4
votes
0answers
64 views

Graph Partition

Consider a graph 'g': ...
1
vote
1answer
48 views

Splitting a weighted graph

Consider a weighted graph: ...
1
vote
1answer
64 views

Coloring ladder rung graphs

I can use various algorithms to list all proper $k$-colorings of the vertices of the ladder rung graph $nP_2$, the first six are show below. Is there a quick way in Mathematica to list all proper $k$-...
3
votes
2answers
92 views

Counting k-colorings of a graph

Combinatorica can list all $k$-colorings of the vertices of a graph $g$, which is a coloring of the vertices with no two colors adjacent, and using no more than $k$-colors: ...
5
votes
2answers
59 views

Color Specified Edges and Vertices

Is there a more efficient way to code the specifying of selected vertices and edges than listing them separately as shown below? ...
2
votes
1answer
82 views

Stacking and wiring 2 random graphs on top of each other

Suppose we have 2 random graphs, each spatially embedded in a square plane, and vertices connected according to a distance criterion (or different degrees of nearest neighbour). I am trying to figure ...
2
votes
2answers
68 views

Labeling Legs in a Loop on a graph

I am trying to make a graph with some loops such as this one, ...
1
vote
1answer
33 views

Checking if an edge is an element of a list of edges

I have graph whose edge list is given by ...
0
votes
0answers
23 views

Coloring individual edges of a multigraph each with its own color

Could someone tell me how to color two different edges between the same two vertices with a different color? The last time a related question was asked is 4 years ago, so I am wondering if the ...
8
votes
0answers
54 views

Probable bug in EdgeAdd when adding edges to multigraphs

Bug introduced in 10.0 or earlier and persisting through 12.0 M10.0.2 and M10.3 return a wrong result without errors. M11.0 and M12.0 issue a flood of messages and sometimes crash. I am using ...
1
vote
0answers
53 views

Understanding how ComponentMeasurements finds neighbors

I am trying to understand how the module ComponentMeasurements in Mathematica works when the property Neighbors is called in ...
1
vote
1answer
51 views

Combining two directed graphs without loosing any edge

I have two directed graphs given below: one={1 -> 2, 1 -> 3, 3 -> 4, 4 -> 1}; two={1 -> 2, 1 -> 3, 1 -> 4}; I simply want to map the two ...
4
votes
2answers
185 views

How to put the parent node higher than the children nodes in a drawing for a graph?

I have a tree as below. Graph[{7 -> 2, 2 -> 3, 3 -> 4, 3 -> 5}, VertexLabels -> "Name"] However, I want the drawing would put parent nodes at a ...
1
vote
2answers
74 views

Edge list of a graph as a simple list of lists of pairs of integers?

Suppose I have a list of graph edges in the form: e={UndirectedEdge[1,2], UndirectedEdge[3,4]} How can I convert this to a simple list of lists: ...
17
votes
2answers
1k views

Causal Diagrams using Wolfram?

How can one use Wolfram to make diagrams like with the arrows labeled as well (to label "mediating factors" between the causal elements)?
19
votes
2answers
556 views

Creating graph out of particles images

I have recently started learning how to use Mathematica's brilliant image processing tools, and the image I've taken as first example is the following (source): So far I've tried to first use ...
3
votes
1answer
88 views

Reverse graph generation

The more usual way of generating graphs and random graphs, is to start from a mechanism of adding nodes (e.g. randomly embedding or connecting, or randomly rewiring edges, etc), and for which we know ...
10
votes
3answers
1k views

Efficiently finding furthest two nodes in a graph

I am trying to learn how in an efficient way can one find the diameter of a random graph, that is, the longest shortest path, and its corresponding end-nodes. The direct built-in function ...
5
votes
3answers
195 views

Convert graph format for Mathematica graph functions

I have an output of many large graph files, specified by pair of vertices, in a format like ...
0
votes
0answers
35 views

High dimensional integral not evaluating? [duplicate]

I am trying to integrate as follows: ...
3
votes
0answers
61 views

Steiner Tree Approximation

I am wondering about the existence of Mathematica code to find (approximate) Steiner trees in graphs. I know there are a number of algorithms to do so --- just curious if anyone has implemented any ...