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 ArticleHow 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 ArticleQuestions 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 ArticleCount 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 ArticleAdditive 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 ArticleNonintersecting 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 ArticleFindPath 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 ArticleFindPath 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 ArticlePath 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 ArticleDifferent 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 ArticleEdgeShapeFunction 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 ArticleHarder 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 ArticleQuestion 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 ArticleHow 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 ArticleScale 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 ArticleVertex 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 ArticleHow 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 ArticleVisualizing 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 ArticleHow 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 ArticleCreating 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