WOLFRAM

MeshConnectivityGraph
Copy to clipboard.
MeshConnectivityGraph

Copy to clipboard.

gives a graph of points connected by lines.

Copy to clipboard.

gives a graph between cells of dimension d that share a cell of dimension d-1.

Copy to clipboard.
MeshConnectivityGraph[mr,{d,e},r]

gives a graph from cells of dimension d to cells of dimension e that share a cell of dimension r.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Construct a connectivity graph between cells of dimension 0 in a mesh:

Out[1]=1

Points are connected if they shared the same edges:

Out[2]=2

Find a shortest path between two vertices of cell indices {0,1} and {0,96}:

Out[3]=3

Highlight the path:

Out[4]=4

Get the connectivity matrix between faces of an icosahedron:

Out[1]=1

The adjacency matrix:

Out[2]=2

Scope  (4)Survey of the scope of standard use cases

MeshConnectivityGraph works on MeshRegion:

Out[1]=1

BoundaryMeshRegion:

Out[2]=2

Linear regions:

Out[3]=3

MeshConnectivityGraph works on all dimensions:

Out[1]=1

Construct a connectivity graph between cells of dimension 0 in a mesh:

Out[1]=1

Between cells of dimension 0 and 1:

Out[2]=2

Between cells of dimension 0 and 0 sharing the same face:

Out[3]=3

By default, AnnotationRulesInherited annotations are preserved:

Out[1]=1
Out[2]=2

With the setting AnnotationRulesNone, annotations are not preserved and the graph is indexed:

Out[3]=3
Out[4]=4

Options  (81)Common values & functionality for each option

AnnotationRules  (4)

Specify an annotation for vertices:

Out[1]=1

Edges:

Out[1]=1

Graph itself:

Out[1]=1
Out[2]=2

With the setting AnnotationRulesNone, annotations are not preserved and the graph is indexed:

Out[1]=1
Out[2]=2

DirectedEdges  (1)

By default, a directed path is generated when computing connectivity between cells of different dimensions:

Out[1]=1

Use DirectedEdges->False to interpret rules as undirected edges:

Out[2]=2

EdgeLabels  (7)

Label the edge {0,1}{0,2}:

Out[1]=1

Label all edges individually:

Out[2]=2

Use any expression as a label:

Out[1]=1

Use Placed with symbolic locations to control label placement along an edge:

Out[1]=1

Use explicit coordinates to place labels:

Out[1]=1

Vary positions within the label:

Out[2]=2

Place multiple labels:

Out[1]=1
Out[2]=2

Use automatic labeling by values through Tooltip and StatusArea:

Out[1]=1
Out[2]=2

EdgeShapeFunction  (6)

Get a list of built-in settings for EdgeShapeFunction:

Out[1]=1

Undirected edges including the basic line:

Out[1]=1

Lines with different glyphs on the edges:

Out[2]=2

Directed edges including solid arrows:

Out[1]=1

Line arrows:

Out[2]=2

Open arrows:

Out[3]=3

Specify an edge function for an individual edge:

Out[1]=1

Combine with a different default edge function:

Out[2]=2

Draw edges by running a program:

Out[2]=2

EdgeShapeFunction can be combined with EdgeStyle:

Out[1]=1

EdgeShapeFunction has higher priority than EdgeStyle:

Out[2]=2

EdgeStyle  (2)

Style all edges:

Out[1]=1

Style individual edges:

Out[1]=1

EdgeWeight  (2)

Specify a weight for all edges:

Out[1]=1

Use any numeric expression as a weight:

Out[1]=1

GraphHighlight  (3)

Highlight the vertex 1:

Out[1]=1

Highlight the edge {0,2}{0,3}:

Out[1]=1

Highlight vertices and edges:

Out[1]=1

GraphHighlightStyle  (2)

Get a list of built-in settings for GraphHighlightStyle:

Out[1]=1

Use built-in settings for GraphHighlightStyle:

Out[1]=1

GraphLayout  (5)

By default, the layout is chosen automatically:

Out[1]=1

Specify layouts on special curves:

Out[1]=1

Specify layouts that satisfy optimality criteria:

Out[1]=1

VertexCoordinates overrides GraphLayout coordinates:

Out[1]=1

Use AbsoluteOptions to extract VertexCoordinates computed using a layout algorithm:

Out[1]=1
Out[2]=2

PlotTheme  (4)

Base Themes  (2)

Use a common base theme:

Out[1]=1

Use a monochrome theme:

Out[1]=1

Feature Themes  (2)

Use a large graph theme:

Out[1]=1

Use a classic diagram theme:

Out[1]=1

VertexCoordinates  (2)

By default, any vertex coordinates are computed automatically:

Out[1]=1

Extract the resulting vertex coordinates using AbsoluteOptions:

Out[2]=2

Specify a layout function along an ellipse:

Out[2]=2

Use it to generate vertex coordinates for a graph:

Out[3]=3

VertexLabels  (13)

Use vertex names as labels:

Out[1]=1

Label individual vertices:

Out[1]=1

Label all vertices:

Out[1]=1

Use any expression as a label:

Out[1]=1

Use Placed with symbolic locations to control label placement, including outside positions:

Out[1]=1

Symbolic outside corner positions:

Out[2]=2

Symbolic inside positions:

Out[1]=1

Symbolic inside corner positions:

Out[2]=2

Use explicit coordinates to place the center of labels:

Out[1]=1

Place all labels at the upper-right corner of the vertex and vary the coordinates within the label:

Out[1]=1

Place multiple labels:

Out[1]=1

Any number of labels can be used:

Out[2]=2

Use the argument to Placed to control formatting including Tooltip:

Out[1]=1

Or StatusArea:

Out[2]=2

Use more elaborate formatting functions:

Out[2]=2
Out[4]=4
Out[6]=6

VertexShape  (5)

Use any Graphics, Image or Graphics3D as a vertex shape:

Out[1]=1

Specify vertex shapes for individual vertices:

Out[1]=1

VertexShape can be combined with VertexSize:

Out[1]=1

VertexShape is not affected by VertexStyle:

Out[1]=1

VertexShapeFunction has higher priority than VertexShape:

Out[1]=1

VertexShapeFunction  (10)

Get a list of built-in collections for VertexShapeFunction:

Out[1]=1

Use built-in settings for VertexShapeFunction in the "Basic" collection:

Out[1]=1

Simple basic shapes:

Out[2]=2

Common basic shapes:

Out[3]=3

Use built-in settings for VertexShapeFunction in the "Rounded" collection:

Out[1]=1
Out[2]=2

Use built-in settings for VertexShapeFunction in the "Concave" collection:

Out[1]=1
Out[2]=2

Draw individual vertices:

Out[1]=1

Combine with a default vertex function:

Out[2]=2

Draw vertices using a predefined graphic:

Out[1]=1

Draw vertices by running a program:

Out[2]=2

VertexShapeFunction can be combined with VertexStyle:

Out[2]=2

VertexShapeFunction has higher priority than VertexStyle:

Out[4]=4

VertexShapeFunction can be combined with VertexSize:

Out[1]=1

VertexShapeFunction has higher priority than VertexShape:

Out[1]=1

VertexSize  (8)

By default, the size of vertices is computed automatically:

Out[1]=1

Specify the size of all vertices using symbolic vertex size:

Out[1]=1

Use a fraction of the minimum distance between vertex coordinates:

Out[1]=1

Use a fraction of the overall diagonal for all vertex coordinates:

Out[1]=1

Specify size in both the and directions:

Out[1]=1

Specify the size for individual vertices:

Out[1]=1

VertexSize can be combined with VertexShapeFunction:

Out[1]=1

VertexSize can be combined with VertexShape:

Out[1]=1

VertexStyle  (5)

Style all vertices:

Out[1]=1

Style individual vertices:

Out[1]=1

VertexShapeFunction can be combined with VertexStyle:

Out[2]=2

VertexShapeFunction has higher priority than VertexStyle:

Out[4]=4

VertexStyle can be combined with BaseStyle:

Out[1]=1

VertexStyle has higher priority than BaseStyle:

Out[2]=2

VertexShape is not affected by VertexStyle:

Out[1]=1

VertexWeight  (2)

Set the weight for all vertices:

Out[1]=1
Out[2]=2

Use any numeric expression as a weight:

Out[1]=1
Out[2]=2

Applications  (10)Sample problems that can be solved with this function

Basic Applications  (5)

Triangle connectivity graph:

Point to point:

Out[2]=2

Point to edge sharing the same face:

Out[5]=5

Cube connectivity graph:

Point to point:

Out[2]=2

Point to edge sharing the same face:

Out[3]=3

Menger mesh connectivity graph:

Out[1]=1

Point to point:

Out[2]=2

Point to edge sharing the same face:

Out[3]=3

3D boundary mesh connectivity graph:

Point to point:

Out[2]=2

Point to edge sharing the same face:

Out[3]=3

Get the face adjacency of a Voronoi mesh:

Out[2]=2
Out[4]=4

Adjacency Queries  (1)

Use the mesh connectivity graph to find point-point adjacency in a mesh:

Out[1]=1

Find all the points that are connected to the point with cell index {0,1}:

Out[2]=2

Polyhedra Operations  (1)

Use MeshConnectivityGraph to compute the DualPolyhedron of a cuboid:

Compute the connectivity graph between points and faces:

Out[2]=2

Get the adjacent faces for each point:

Out[4]=4

Compute the coordinates of the dual:

Out[7]=7

Construct the dual of the cube:

Out[8]=8
Out[9]=9

Topological Operations  (3)

Use MeshConnectivityGraph to test whether a mesh is connected:

Out[2]=2

Use MeshConnectivityGraph to compute ConnectedMeshComponents:

Connected components of a mesh connectivity graph:

Out[2]=2

Group the mesh cells to different mesh connected components:

Out[5]=5

Get mesh connected components:

Out[6]=6

-skeleton graph of Platonic solids:

Out[1]=1

Properties & Relations  (3)Properties of the function, and connections to other functions

The cell of index {d,k} corresponds to the vertex :

Out[1]=1
Out[2]=2

MeshConnectivityGraph between cells of different dimensions is a directed bipartite graph:

Out[1]=1
Out[2]=2
Out[3]=3

The AdjacencyMatrix of a mesh connectivity graph between cells of the same dimension is symmetric:

Out[1]=1
Out[2]=2
Out[3]=3

Neat Examples  (1)Surprising or curious use cases

Different dimensional connectivity graphs of a Menger mesh:

Out[1]=1
Wolfram Research (2020), MeshConnectivityGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html.
Copy to clipboard.
Wolfram Research (2020), MeshConnectivityGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html.

Text

Wolfram Research (2020), MeshConnectivityGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html.

Copy to clipboard.
Wolfram Research (2020), MeshConnectivityGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html.

CMS

Wolfram Language. 2020. "MeshConnectivityGraph." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html.

Copy to clipboard.
Wolfram Language. 2020. "MeshConnectivityGraph." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html.

APA

Wolfram Language. (2020). MeshConnectivityGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html

Copy to clipboard.
Wolfram Language. (2020). MeshConnectivityGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html

BibTeX

@misc{reference.wolfram_2025_meshconnectivitygraph, author="Wolfram Research", title="{MeshConnectivityGraph}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html}", note=[Accessed: 17-March-2025 ]}

Copy to clipboard.
@misc{reference.wolfram_2025_meshconnectivitygraph, author="Wolfram Research", title="{MeshConnectivityGraph}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html}", note=[Accessed: 17-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_meshconnectivitygraph, organization={Wolfram Research}, title={MeshConnectivityGraph}, year={2020}, url={https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html}, note=[Accessed: 17-March-2025 ]}

Copy to clipboard.
@online{reference.wolfram_2025_meshconnectivitygraph, organization={Wolfram Research}, title={MeshConnectivityGraph}, year={2020}, url={https://reference.wolfram.com/language/ref/MeshConnectivityGraph.html}, note=[Accessed: 17-March-2025 ]}