How to arbitrarily specify a face of planar graph as an external surface and draw it?

I learned this theorem in the graph theory textbook.

Theorem Every $ 2$ -connected plane graph can be embedded in the plane so that any specified face is the exterior.

G=PlanarGraph[{1 <-> 2, 1 <-> 3, 1 <-> 4, 2 <-> 3,               3 <-> 4, 2 <-> 5, 5 <-> 6, 6 <-> 3},               VertexLabels -> All] 

enter image description here

In the above embedding of this graph, we know $ 1256341$ is boundary exterior face of $ G$ .

I don’t know if there is a way to make the triangle face $ \Delta_{134}$ outside.

The above is just an example. For the graph $ G$ , maybe I can change the layout of some points by VertexCoordinates. But for the large number of vertices, I don’t know if there is a good and unified way to arbitrarily specify an external face and give a good plane drawing.

How to align a network graph to an image?

An arbitrary example:

Create a random image

Image[RandomReal[{0, 1}, {10, 10}], ImageSize -> Medium] 

enter image description here

Define some points and a graph to align

c = PixelValuePositions[%, White, .1] RandomGraph[Table[Length[c], 2]] 

enter image description here

Out[1]: {{2, 9}, {1, 8}, {1, 7}, {2, 7}, {9, 6}, {2, 2}} 

How can I align the nodes of a graph to coordinates on an image?

Ideally this would be a graph from a correlation matrix

RandomReal[{-1, 1}, Table[Length[c], 2]] // MatrixForm  

Coloured integers: Select outcome unexpected (part of a graph based problem using coloured vertex labels)

I use the following code output and need to retrieve the position of the part containing the blue-coloured integer 4

Part 1:

List[Placed[List[       Style[3, Rule[LineColor, RGBColor[1, 0, 0]],         Rule[FrontFaceColor, RGBColor[1, 0, 0]],         Rule[BackFaceColor, RGBColor[1, 0, 0]],         Rule[GraphicsColor, RGBColor[1, 0, 0]],         Rule[FontColor, RGBColor[1, 0, 0]]],        Style[4, Rule[LineColor, RGBColor[0, 0, 1]],         Rule[FrontFaceColor, RGBColor[0, 0, 1]],         Rule[BackFaceColor, RGBColor[0, 0, 1]],         Rule[GraphicsColor, RGBColor[0, 0, 1]],         Rule[FontColor, RGBColor[0, 0, 1]]]], List[Before, After]], Placed[      List[Style[4, Rule[LineColor, RGBColor[1, 0, 0]],         Rule[FrontFaceColor, RGBColor[1, 0, 0]],         Rule[BackFaceColor, RGBColor[1, 0, 0]],         Rule[GraphicsColor, RGBColor[1, 0, 0]],         Rule[FontColor, RGBColor[1, 0, 0]]],        Style[3, Rule[LineColor, RGBColor[0, 0, 1]],         Rule[FrontFaceColor, RGBColor[0, 0, 1]],         Rule[BackFaceColor, RGBColor[0, 0, 1]],         Rule[GraphicsColor, RGBColor[0, 0, 1]],         Rule[FontColor, RGBColor[0, 0, 1]]]], List[Before, After]]] 

I tried:

Part 2:

        Select[List[Placed[List[               Style[3, Rule[LineColor, RGBColor[1, 0, 0]],                 Rule[FrontFaceColor, RGBColor[1, 0, 0]],                 Rule[BackFaceColor, RGBColor[1, 0, 0]],                 Rule[GraphicsColor, RGBColor[1, 0, 0]],                 Rule[FontColor, RGBColor[1, 0, 0]]],                Style[4, Rule[LineColor, RGBColor[0, 0, 1]],                 Rule[FrontFaceColor, RGBColor[0, 0, 1]],                 Rule[BackFaceColor, RGBColor[0, 0, 1]],                 Rule[GraphicsColor, RGBColor[0, 0, 1]],                 Rule[FontColor, RGBColor[0, 0, 1]]]], List[Before, After]], Placed[              List[Style[4, Rule[LineColor, RGBColor[1, 0, 0]],                 Rule[FrontFaceColor, RGBColor[1, 0, 0]],                 Rule[BackFaceColor, RGBColor[1, 0, 0]],                 Rule[GraphicsColor, RGBColor[1, 0, 0]],                 Rule[FontColor, RGBColor[1, 0, 0]]],                Style[3, Rule[LineColor, RGBColor[0, 0, 1]],                 Rule[FrontFaceColor, RGBColor[0, 0, 1]],                 Rule[BackFaceColor, RGBColor[0, 0, 1]],                 Rule[GraphicsColor, RGBColor[0, 0, 1]],                 Rule[FontColor, RGBColor[0, 0, 1]]]], List[Before, After]]], Select[#[[1]][[2]], IntegerQ] &  == 4] 

Which produces { }

However

Part 3

 a = Placed[     List[Style[3, Rule[LineColor, RGBColor[1, 0, 0]],        Rule[FrontFaceColor, RGBColor[1, 0, 0]],        Rule[BackFaceColor, RGBColor[1, 0, 0]],        Rule[GraphicsColor, RGBColor[1, 0, 0]],        Rule[FontColor, RGBColor[1, 0, 0]]],       Style[4, Rule[LineColor, RGBColor[0, 0, 1]],        Rule[FrontFaceColor, RGBColor[0, 0, 1]],        Rule[BackFaceColor, RGBColor[0, 0, 1]],        Rule[GraphicsColor, RGBColor[0, 0, 1]],        Rule[FontColor, RGBColor[0, 0, 1]]]],      List[Before, After]][[1]][[2]]  Select[a,IntegerQ] 

produces 4 as expected.

Hence I would have expected Part 2 to produce the expression containing the blue label 4, i.e. the following result

Placed[List[           Style[3, Rule[LineColor, RGBColor[1, 0, 0]],             Rule[FrontFaceColor, RGBColor[1, 0, 0]],             Rule[BackFaceColor, RGBColor[1, 0, 0]],             Rule[GraphicsColor, RGBColor[1, 0, 0]],             Rule[FontColor, RGBColor[1, 0, 0]]],            Style[4, Rule[LineColor, RGBColor[0, 0, 1]],             Rule[FrontFaceColor, RGBColor[0, 0, 1]],             Rule[BackFaceColor, RGBColor[0, 0, 1]],             Rule[GraphicsColor, RGBColor[0, 0, 1]],             Rule[FontColor, RGBColor[0, 0, 1]]]], List[Before, After]] 

On closer inspection I tried the following:

FullForm[Select[a, IntegerQ]] 

which results in

Style[4] 

However, Style[4] should not be the result of a selection for integers.

What is going on?

Creating a directed weighted graph by using a database

Given a database in matrix format:

SeedRandom[6]; mat = RandomInteger[5, {27, 30}]; mat[[1, All]] = {"", a1, a2, a3, a4, a5, b1, b2, b3, b4, b5, c1, c2,     c3, c4, c5, d1, d2, d3, d4, d5, afd1, afd2, bfd1, bfd2, cfd1, cfd2,    dfd1, dfd2, TD}; mat[[All, 1]] = {"", a1, a2, a3, a4, a5, b1, b2, b3, b4, b5, c1, c2,     c3, c4, c5, d1, d2, d3, d4, d5, aT, bT, cT, dT, VA, TS}; 

Each row and column has a name, e.g., a1, a2, .... Suppose the following operations on mat.

  1. Drop the columns {a1, a3, b1, b2, c4, c5, d2, d5} and the rows with the same names.
  2. Create a weighted directed graph using the columns {a2, a4, a5, b3, b4, b5, c1, c2, c3, d1, d3, d4} and the rows with the same names.

My question is not about the operations referred to in [1] and [2]. I like to know how to keep the linkage between a string vertex name and a numeric vertex name. String names for the list in [2] are {a2, a4, a5, b3, b4, b5, c1, c2, c3, d1, d3, d4} and the associated numeric names are {2, 4, 5, 8, 9, 10, 11, 12, 13, 16, 18, 19}.

Because my original matrix is large, with the operation in item [1], I lose the linkage between numeric and string names, which I need in later stages of output formatting. For example, I can easily find Cliques with numeric vertex names but I need to know the string names linked to the numeric vertices.

Any suggestion?

A graph database suitable for analyzing a heap snapshot?

It looks like recommendation questions aren’t explicitly OT, so here goes:

I’m working on some tooling for analyzing a dump of the heap of a running program. The dump is just a list of nodes with associated metadata and references to other nodes (possibly-cyclical).

I don’t have any experience with graph databases, and I’m wondering if I would save myself a lot of time by building tooling around a graph DB. So I’m looking for recommendations and pointers to resources, and advice.

Some specific questions:

  • are there any graph databases that have functionality built in for computing a dominator tree? (googling this didn’t seem to get any results)
  • are there any DBs that have tooling for visualizing a huge graph?

How to add the weights to the transition graph of a Markov chain?

The following working program uses Graph and Markov Chain

P = {{1/2, 1/2, 0, 0}, {1/2, 1/2, 0, 0}, {1/4, 1/4, 1/4, 1/4}, {0, 0,     0, 1}}; proc = DiscreteMarkovProcess[3, P]; Graph[proc, GraphStyle -> "DiagramBlue",   EdgeLabels ->    With[{sm = MarkovProcessProperties[proc, "TransitionMatrix"]},     Flatten@Table[DirectedEdge[i, j] -> sm[[i, j]], {i, 2}, {j, 2}]]]  sm = MarkovProcessProperties[proc, "TransitionMatrix"] sm == P 

Since I couldn’t make it work for larger matrices, I clarified in the last two lines that sm is just P. But, if I try to replace sm by P in the first part, all hell breaks loose. So, I tried copy paste changing just P to a larger matrix, but this does not work. Why?

P = {{0, 1/4, 1/2, 1/4, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 1/3, 0, 2/3,      0}, {0, 0, 0, 0, 0, 1},    {0, 0, 1/4, 0, 3/4, 0}, {1/4, 0, 0, 0, 3/4, 0}}; P // MatrixForm proc = DiscreteMarkovProcess[1, P]; Graph[proc,   EdgeLabels ->    With[{sm = MarkovProcessProperties[proc, "TransitionMatrix"]},     Flatten@Table[DirectedEdge[i, j] -> sm[[i, j]], {i, 6}, {j, 6}]]] 

Weird looking ListDensityPlot graph

I am trying to use the following set of data to plot a 3D graph.

data = {{0.1`, -200, 2.47349`}, {0.1`, -180, 2.34881`}, {0.1`, -160,     2.215`}, {0.1`, -140, 2.08`}, {0.1`, -120, 1.93`}, {0.1`, -100,     1.84`}, {0.1`, -80, 1.69`}, {0.1`, -60, 1.53`}, {0.1`, -40,     1.46`}, {0.1`, -20, 1.19`}, {0.1`, 0, 1.62`}, {0.2`, -200,     2.46`}, {0.2`, -180, 2.163`}, {0.2`, -160, 1.95`}, {0.2`, -140,     1.73`}, {0.2`, -120, 1.52`}, {0.2`, -100, 1.36`}, {0.2`, -80,     1.12`}, {0.2`, -60, 0.9078`}, {0.2`, -40, 0.82`}, {0.2`, -20,     0.83`}, {0.2`, 0, 0.948`}, {0.3`, -200, 2.097`}, {0.3`, -180,     1.853`}, {0.3`, -160, 1.53`}, {0.3`, -140, 1.295`}, {0.3`, -120,     1.062`}, {0.3`, -100, 0.875`}, {0.3`, -80, 0.6164`}, {0.3`, -60,     0.4163`}, {0.3`, -40, 0.254`}, {0.3`, -20, 0.196`}, {0.3`, 0,     0.323`}, {0.4`, -200, 1.74`}, {0.4`, -180, 1.42`}, {0.4`, -160,     1.174`}, {0.4`, -140, 0.936`}, {0.4`, -120, 0.749`}, {0.4`, -100,     0.503`}, {0.4`, -80,     0.2565`}, {0.4`, -55, -0.0507`}, {0.4`, -35, -0.2962`}, {0.4`, \ -20, -0.264`}, {0.4`, 0, -0.133`}, {0.5`, -190, 1.3452`}, {0.5`, -170,     1.0393`}, {0.5`, -160, 0.92`}, {0.5`, -140, 0.736`}, {0.5`, -120,     0.45`}, {0.5`, -90,     0.1056`}, {0.5`, -70, -0.1159`}, {0.5`, -50, -0.32422`}, {0.5`, \ -40, -0.419`}, {0.5`, -20, -0.573`}, {0.5`, 0, -0.43`}, {0.6`, -200,     1.183`}, {0.6`, -180, 1.006`}, {0.6`, -170, 0.888`}, {0.6`, -150,     0.653`}, {0.6`, -130, 0.42`}, {0.6`, -100,     0.074`}, {0.6`, -80, -0.149`}, {0.6`, -50, -0.475`}, {0.6`, -40, \ -0.613`}, {0.6`, -10, -0.772`}, {0.6`, 0, -0.6`}, {0.7`, -200,     1.19`}, {0.7`, -165, 0.776`}, {0.7`, -160, 0.717`}, {0.7`, -130,     0.365`}, {0.7`, -110, 0.162`}, {0.7`, -100,     0.0176`}, {0.7`, -70, -0.315`}, {0.7`, -60, -0.432`}, {0.7`, -40, \ -0.672`}, {0.7`, -20, -0.8212`}, {0.7`, 0, -0.66`}, {0, -200,     1.937`}, {0, -180, 1.937`}, {0, -160, 1.937`}, {0, -140,     1.937`}, {0, -120, 1.937`}, {0, -100, 1.937`}, {0, -80,     1.937`}, {0, -60, 1.937`}, {0, -40, 1.937`}, {0, -20, 1.937`}, {0,     0, 1.937`}, {0.7855`, -200, 1.2206`}, {0.7855`, -170,     0.865`}, {0.7855`, -160, 0.745`}, {0.7855`, -140,     0.507`}, {0.7855`, -130, 0.388`}, {0.7855`, -110,     0.152`}, {0.7855`, -80, -0.195`}, {0.7855`, -50, -0.534`}, \ {0.7855`, -40, -0.666`}, {0.7855`, -10, -0.897`}, {0.7855`,     0, -0.609`}, {"", "", ""}, {0.15`, -180, 2.37`}, {"", "",     ""}, {0.15`, -140, 1.93433`}, {0.15`, -120, 1.7464`}, {0.15`, -100,     1.61726`}, {0.15`, -80, 1.41843`}, {"", "", ""}, {"", "",     ""}, {"", "", ""}, {0.15`, 0, 1.29525`}, {0.25`, -200,     2.20387`}, {"", "", ""}, {0.25`, -160, 1.73875`}, {"", "",     ""}, {0.25`, -120, 1.34535`}, {0.25`, -100, 1.10704`}, {0.25`, -80,     0.852466`}, {"", "", ""}, {0.25`, -40, 0.518832`}, {"", "",     ""}, {0.25`, 0, 0.616489`}, {0.05`, -200, 2.17447`}, {0.05`, -180,     2.15766`}, {"", "", ""}, {"", "", ""}, {"", "", ""}, {"", "",     ""}, {0.05`, -80, 1.8539`}, {0.05`, -60, 1.78145`}, {"", "",     ""}, {0.05`, -20, 1.771`}, {0.05`, 0, 1.85024`}}  

However, the final graph is weird (the mesh) enter image description here

It does not work when I increase the InterpolationOrder, and it does not work when I increase the number of data points. What is the problem here? Thank you so much.