Quantcast
Channel: Active questions tagged graphs-and-networks - Mathematica Stack Exchange
Browsing index pages (252 articles)

Image may be NSFW.
Clik here to view.

Get a nice two-page embedding for a planar graph that contains a Hamiltonian...

I’m working with a planar graph (G) that has a Hamiltonian cycle. I want to draw a 2-page (book) embedding using a Hamiltonian cycle as the spine:Question:Put the Hamiltonian cycle of the plane graph...

View Article


Image may be NSFW.
Clik here to view.

How to dynamically drag vertices and edit orthogonal edge paths in a random...

I would like to create an interactive graph editor with two main features:Vertices can be dragged freely to change their positions.Edges can be interactively rerouted as orthogonal polylines, i.e. each...

View Article


Image may be NSFW.
Clik here to view.

Questions about FindHamiltonianCycle and FindShortestTour

Answered, updatedFor some reasons, I'm interested in getting mazes with FindHamiltonianCycle.While not too serious, the questions that arise may be helpful to Mathematica enthusiasts.The simplest code...

View Article

Image may be NSFW.
Clik here to view.

Count chains in complete graph

Let's say I have a complete graph like thisW = {1, 2};n = 5;p2 = 0.5;p1 = 1 - p2;arr = {};AppendTo[arr, RandomChoice[{p1, p2} -> {1, 2}, n]];el1 = VertexList[CompleteGraph[n]];g = CompleteGraph[n,...

View Article

Image may be NSFW.
Clik here to view.

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...

View Article


Nonintersecting lattice paths with given start and endpoints

A prominent topic in combinatorics is the enumeration of nonintersecting lattice paths subject to certain conditions. My goal is fairly simple: given starting points $(1,1), (2,1), \ldots, (k,1)$ and...

View Article

Image may be NSFW.
Clik here to view.

FindPath not finding any path but FindShortestPath does?

Puzzled by this.I have a directed graph, made by a set of hubs and leaves linking to them.Vertices names are strings.I tried to:FindPath = [g, "insight", "perception", Infinity, All]No result.I tried...

View Article

Image may be NSFW.
Clik here to view.

FindPath with required Edges

Suppose I have a graph g with some edges reqEdges (in the example code here, just one edge). I would like to use FindPath to find all of the paths from some point s to some point t, but on the...

View Article


Path finding in Complete Graph [closed]

I have the following Complete Graph with random labels on its edgesW = {1, 2, 3}; n = 5; el = EdgeList[CompleteGraph[n]]; g = CompleteGraph[n, VertexLabels -> "Name", EdgeLabels -> Table[el[[i]]...

View Article


Different EdgeStyle for multiple edges between the same two vertices

Consider the following example:Graph[{a, b, c}, {a <-> b, a <-> b, b <-> c, c <-> a}, EdgeStyle -> {a <-> b -> Dashed}]I want to change the EdgeStyle of one of the...

View Article

Image may be NSFW.
Clik here to view.

EdgeShapeFunction scoping problem

Here are two versions of code that differ in placement of &.The first variant prints the desired result 1, 2, 3 but the definition of EdgeShapeFunction is not preserved.The second variant preserves...

View Article

Image may be NSFW.
Clik here to view.

Harder case of non-intersecting paths

This question is a direct continuation of the post by A. Kato, How to draw multiple non-intersecting curves? The problem really caught my attention because of hard scenarios that can arise and that the...

View Article

Image may be NSFW.
Clik here to view.

Question on the computational graph theory

I am faced with the next problem in computational geometry.Let we have mesh connectivity graph for convex hull mesh of some points on sphere(it's not necessarily SpherePoints[], they're selected for...

View Article


How can I make the thickness of the edges reflect the weights?

How can I represent with thickness of the edges the weights of this graph?Graph[{1 <-> 2, 2 <-> 3, 3 <-> 1}, EdgeWeight -> {1, 3, 5}]

View Article

Image may be NSFW.
Clik here to view.

Scale Vertex by Node Property

I would like to scale the nodes in a network according to various properties of those nodes. It's a fairly common thing to do with networks, but Mathematica's Graph functionality doesn't seem to...

View Article


Vertex sizes scaled by vertex degree?

Is there any way of scaling the sizes of the vertices of a network proportional to the vertex-degrees of the vertices in Mathematica?Thanks.

View Article

Image may be NSFW.
Clik here to view.

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 {1, 3, 4, 5, 3, 2} is such face. We know that it is not always the...

View Article


Image may be NSFW.
Clik here to view.

Visualizing Rubik's Graph

After the August 2010 discovery that the diameter of the Rubik graph is 20, I wanted to make a way to visualize Rubik's graph. Since there are about $4.3 \times 10^{19}$ vertices in this graph, it is...

View Article

How to use Mathematica to calculate the similarity of two graphs?

How to use Mathematica to calculate the similarity of two graphs?Does Graph Optimal Transport based method help?

View Article

Image may be NSFW.
Clik here to view.

Creating hexagonal grid (hexagonal grid graph)

Is there a function that can create hexagonal grid?We have square grid graph, where we can specify m*n dimensions:GridGraph[{m, n}]We have triangular grid graph (which works only for argument n up to...

View Article
Browsing index pages (252 articles)


Latest Images