15 votes
Accepted

Can Mathematica read planar graphs with pc format?

One option is to generate these planar graphs using the plantri program and ask for Graph6 output, which Mathematica can read (and IGraph/M can read faster). ...
user avatar
  • 225k
8 votes
Accepted

Restores a difficult digraph

Set up custom edge function: ...
user avatar
  • 13.5k
7 votes
Accepted

Finding connected components in 2D integer coordinate system

Does this do what you have in mind? ...
user avatar
6 votes

Can you count the number of self-loops per vertex in a graph?

G= Graph[m1]; AssociationThread[ VertexList[G], Normal[Diagonal[AdjacencyMatrix[G]]] ] <|w -> 0, x -> 2, c -> 1, y -> 1, s -> 4, l -> 6, f ...
user avatar
5 votes

Restores a difficult digraph

Color appearance is influenced by what is around. For example, the vertices have thick edges of different colors, which I tried to reproduced below. I changed to color of the edges to match the target....
user avatar
  • 3,782
5 votes

Random graphs in Poincare disk

Szabolcs's suggestion was pretty straightforward to implement, and the math for the Poincaré disk is easy (for those who are familiar with it), so just for giggles, here's my take: ...
4 votes
Accepted

Adding an edge between G1 vx and G2 vy?

You need to join the two graph into a single one before you can add edges between them. Look up GraphDisjointUnion.
user avatar
  • 225k
3 votes

NestGraph Basics

I finally figured this out for those who might be interested, which seems remote :-) While referring to the image of the above graph, we have: ...
user avatar
  • 41
3 votes

Mathematica package to calculate the graph crossing number

There are some C or Java programs available for computing crossing number, but not in wolfram language. But we can call it. One of them is QuickCross. ...
user avatar
  • 763
3 votes

Convert DelaunayTriangulation-> Graph->AdjacencyMatrix

These days, one would do something like the following: pts = RandomReal[1, {18, 2}]; dm = DelaunayMesh[pts]; mcg = MeshConnectivityGraph[dm] and then evaluate <...
user avatar
2 votes
Accepted

Strange Vertex Size Problem when Moving From 999 to 1000 Verteces

You could set up VertexShapeFunction -> "Circle". SetProperty[G, {VertexSize -> vd, VertexShapeFunction -> "Circle"}]
user avatar
  • 13.5k
2 votes

Counting the number of triangles of a multigraph

I think the following works. It finds 64 triangles in your multigraph. ...
user avatar
2 votes
Accepted

Calculating distance between a set of random points in hyperbolic space

One can both solve the geodesic equations and integrate to find the length of the geodesic numerically. There are packages for working with tensors (notably xAct), but here's a quick-and-dirty hacked-...
user avatar
  • 8,208
2 votes
Accepted

How to get a plane drawing according to the rotation system given

IGEmbeddingToCoordinates from IGraph/M will do this. However, the result is not usually pretty. Try IGLayoutPlanar on a few ...
user avatar
  • 225k
1 vote

Could a function such as Slot be used in this genetic code analysis?

Reading between the lines, I tend to believe OP's actual question is how to work with this large abount of data. Here are a couple of suggestions. I'd generally suggest to use strings and not symbols ...
user avatar
1 vote

GraphUnion in Mathematica 12 vs 13

If you want to write code that works correctly in versions from before and after this bug was fixed, use a lightweight wrapper function: ...
user avatar
  • 63.2k
1 vote

CommunityGraphPlot colors the communites automatically. Is it possible to access a list of those colors, ordered by community?

With the help of Szabolcs' comment (thanks!), I was able to come up with the following, which does what I need. ...
user avatar
1 vote

Spanning Subgraphs of random sizes with probabilities on edges

If you want to retain each edge in a graph g with probability p, you can use: ...
user avatar
  • 225k
1 vote

Vertex sizes scaled by vertex degree?

This code scales the vertex size and attaches a heatmap color to the vertices. The result is as follows: ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible