MeshConnectivityGraphCopy to clipboard.
✖
MeshConnectivityGraph
gives a graph between cells of dimension d that share a cell of dimension d-1.
gives a graph from cells of dimension d to cells of dimension e that share a cell of dimension r.
Details and Options


- MeshConnectivityGraph is also known as mesh adjacency graph and mesh incidence graph.
- Typical uses include getting cell adjacencies and topological information in a mesh.
- A vertex {d,i} in the connectivity graph corresponds to the cell cd,i with dimension d and index i in the mesh mr.
- An undirected edge in MeshConnectivityGraph[mr,d]connects two vertices {d,i} and {d,j} whenever the cells cd,i and cd,j both have a common subcell of dimension d-1. For d=0, the common subcell has dimension 1.
- Common cases for d are:
-
0 points that share a line 1 lines that share a point 2 polygons that share an edge 3 polyhedra that share a polygon - In MeshConnectivityGraph[mr,{d,e},r], a directed edge connects the vertex {d,i} to the vertex {e,j} whenever the cells cd,i and ce,j have a common cell of dimension r that is either a subset or a superset of cd,i and ce,j.
- MeshConnectivityGraph[mr] is effectively equivalent to MeshConnectivityGraph[mr,0].
- MeshConnectivityGraph[mr,d,r] is equivalent to the undirected graph of the graph MeshConnectivityGraph[mr,{d,d},r].
- MeshConnectivityGraph takes the same options as Graph with the following changes:
-
AnnotationRules Inherited -
AlignmentPoint Center the default point in the graphic to align with AnnotationRules {} annotations for graph, edges and vertices AspectRatio Automatic ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool DirectedEdges Automatic whether to interpret Rule as DirectedEdge EdgeLabels None labels and label placements for edges EdgeLabelStyle Automatic style to use for edge labels EdgeShapeFunction Automatic generate graphic shapes for edges EdgeStyle Automatic style used for edges EdgeWeight Automatic weights for edges Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GraphHighlight {} graph elements to highlight GraphHighlightStyle Automatic style for highlight GraphLayout Automatic how to lay out vertices and edges GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels Method Automatic details of graphics methods to use PerformanceGoal Automatic aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotRange All range of values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotTheme $PlotTheme overall theme for the graph PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks VertexCoordinates Automatic coordinates for vertices VertexLabels None labels and placements for vertices VertexLabelStyle Automatic style to use for vertex labels VertexShape Automatic graphic shape for vertices VertexShapeFunction Automatic generate graphic shapes for vertices VertexSize Medium size of vertices VertexStyle Automatic styles for vertices VertexWeight Automatic weights for vertices

List of all options




Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Construct a connectivity graph between cells of dimension 0 in a mesh:

https://wolfram.com/xid/0mk4k5udp93e-3y5ymm

Points are connected if they shared the same edges:

https://wolfram.com/xid/0mk4k5udp93e-ksccty

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

https://wolfram.com/xid/0mk4k5udp93e-7libmg


https://wolfram.com/xid/0mk4k5udp93e-h9ckjm

Get the connectivity matrix between faces of an icosahedron:

https://wolfram.com/xid/0mk4k5udp93e-d0lttj


https://wolfram.com/xid/0mk4k5udp93e-y1a0wz

Scope (4)Survey of the scope of standard use cases
MeshConnectivityGraph works on MeshRegion:

https://wolfram.com/xid/0mk4k5udp93e-3410at


https://wolfram.com/xid/0mk4k5udp93e-3gqp5z


https://wolfram.com/xid/0mk4k5udp93e-rr69zt

MeshConnectivityGraph works on all dimensions:

https://wolfram.com/xid/0mk4k5udp93e-19f9qf

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

https://wolfram.com/xid/0mk4k5udp93e-r98olx

Between cells of dimension 0 and 1:

https://wolfram.com/xid/0mk4k5udp93e-uz87bh

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

https://wolfram.com/xid/0mk4k5udp93e-skigpa

By default, AnnotationRulesInherited annotations are preserved:

https://wolfram.com/xid/0mk4k5udp93e-esabpo


https://wolfram.com/xid/0mk4k5udp93e-d2w4ut

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

https://wolfram.com/xid/0mk4k5udp93e-pb9r8q


https://wolfram.com/xid/0mk4k5udp93e-2i099p

Options (81)Common values & functionality for each option
AnnotationRules (4)
Specify an annotation for vertices:

https://wolfram.com/xid/0mk4k5udp93e-bugzer


https://wolfram.com/xid/0mk4k5udp93e-uk5apf


https://wolfram.com/xid/0mk4k5udp93e-34likd


https://wolfram.com/xid/0mk4k5udp93e-fits1l

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

https://wolfram.com/xid/0mk4k5udp93e-5ucq7n


https://wolfram.com/xid/0mk4k5udp93e-821bt3

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

https://wolfram.com/xid/0mk4k5udp93e-iwq8nh

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

https://wolfram.com/xid/0mk4k5udp93e-hsbm48

EdgeLabels (7)

https://wolfram.com/xid/0mk4k5udp93e-i4hhul


https://wolfram.com/xid/0mk4k5udp93e-on3q2f

https://wolfram.com/xid/0mk4k5udp93e-5fleij

Use any expression as a label:

https://wolfram.com/xid/0mk4k5udp93e-y06xgn

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

https://wolfram.com/xid/0mk4k5udp93e-5vdnyp

Use explicit coordinates to place labels:

https://wolfram.com/xid/0mk4k5udp93e-01bjkg

Vary positions within the label:

https://wolfram.com/xid/0mk4k5udp93e-8v40a0


https://wolfram.com/xid/0mk4k5udp93e-kl0jke


https://wolfram.com/xid/0mk4k5udp93e-hb7fqh

Use automatic labeling by values through Tooltip and StatusArea:

https://wolfram.com/xid/0mk4k5udp93e-xffrhw


https://wolfram.com/xid/0mk4k5udp93e-bd0d90

EdgeShapeFunction (6)
Get a list of built-in settings for EdgeShapeFunction:

https://wolfram.com/xid/0mk4k5udp93e-hfmhqu

Undirected edges including the basic line:

https://wolfram.com/xid/0mk4k5udp93e-fjhml

Lines with different glyphs on the edges:

https://wolfram.com/xid/0mk4k5udp93e-lxjrsx

Directed edges including solid arrows:

https://wolfram.com/xid/0mk4k5udp93e-lvr0ss


https://wolfram.com/xid/0mk4k5udp93e-qslbt


https://wolfram.com/xid/0mk4k5udp93e-f6ch7m

Specify an edge function for an individual edge:

https://wolfram.com/xid/0mk4k5udp93e-eczrhp

Combine with a different default edge function:

https://wolfram.com/xid/0mk4k5udp93e-jwjk2c

Draw edges by running a program:

https://wolfram.com/xid/0mk4k5udp93e-j0dznf

https://wolfram.com/xid/0mk4k5udp93e-lsgwlp

EdgeShapeFunction can be combined with EdgeStyle:

https://wolfram.com/xid/0mk4k5udp93e-gt52v9

EdgeShapeFunction has higher priority than EdgeStyle:

https://wolfram.com/xid/0mk4k5udp93e-cfn5oz

EdgeStyle (2)
EdgeWeight (2)
Specify a weight for all edges:

https://wolfram.com/xid/0mk4k5udp93e-8fxi6


https://wolfram.com/xid/0mk4k5udp93e-baprxk

Use any numeric expression as a weight:

https://wolfram.com/xid/0mk4k5udp93e-bcptub


https://wolfram.com/xid/0mk4k5udp93e-fibbsw

GraphHighlight (3)

https://wolfram.com/xid/0mk4k5udp93e-t1013k

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

https://wolfram.com/xid/0mk4k5udp93e-ewa020


https://wolfram.com/xid/0mk4k5udp93e-bz747

GraphHighlightStyle (2)
Get a list of built-in settings for GraphHighlightStyle:

https://wolfram.com/xid/0mk4k5udp93e-lu7p68

Use built-in settings for GraphHighlightStyle:

https://wolfram.com/xid/0mk4k5udp93e-qwjuvn

GraphLayout (5)
By default, the layout is chosen automatically:

https://wolfram.com/xid/0mk4k5udp93e-pk5sa7

Specify layouts on special curves:

https://wolfram.com/xid/0mk4k5udp93e-b7q2dk

Specify layouts that satisfy optimality criteria:

https://wolfram.com/xid/0mk4k5udp93e-de5dy6

VertexCoordinates overrides GraphLayout coordinates:

https://wolfram.com/xid/0mk4k5udp93e-cwwgxk

Use AbsoluteOptions to extract VertexCoordinates computed using a layout algorithm:

https://wolfram.com/xid/0mk4k5udp93e-dwfzcc


https://wolfram.com/xid/0mk4k5udp93e-bqxnuk

PlotTheme (4)
Base Themes (2)
VertexCoordinates (2)
By default, any vertex coordinates are computed automatically:

https://wolfram.com/xid/0mk4k5udp93e-5spor

Extract the resulting vertex coordinates using AbsoluteOptions:

https://wolfram.com/xid/0mk4k5udp93e-2whoh

Specify a layout function along an ellipse:

https://wolfram.com/xid/0mk4k5udp93e-mwyuvu

https://wolfram.com/xid/0mk4k5udp93e-cvx31k

Use it to generate vertex coordinates for a graph:

https://wolfram.com/xid/0mk4k5udp93e-uukkr

VertexLabels (13)

https://wolfram.com/xid/0mk4k5udp93e-c9ka50


https://wolfram.com/xid/0mk4k5udp93e-i40mcj


https://wolfram.com/xid/0mk4k5udp93e-whkpg

Use any expression as a label:

https://wolfram.com/xid/0mk4k5udp93e-kokbex

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

https://wolfram.com/xid/0mk4k5udp93e-csc6y

Symbolic outside corner positions:

https://wolfram.com/xid/0mk4k5udp93e-405x2

https://wolfram.com/xid/0mk4k5udp93e-fjgxt8


https://wolfram.com/xid/0mk4k5udp93e-fg0pin

Symbolic inside corner positions:

https://wolfram.com/xid/0mk4k5udp93e-kfrv7

https://wolfram.com/xid/0mk4k5udp93e-dr87wv

Use explicit coordinates to place the center of labels:

https://wolfram.com/xid/0mk4k5udp93e-cqfi4r

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

https://wolfram.com/xid/0mk4k5udp93e-20sv


https://wolfram.com/xid/0mk4k5udp93e-kusfg3

Any number of labels can be used:

https://wolfram.com/xid/0mk4k5udp93e-fqezh

Use the argument to Placed to control formatting including Tooltip:

https://wolfram.com/xid/0mk4k5udp93e-cxzeiw

Or StatusArea:

https://wolfram.com/xid/0mk4k5udp93e-nddwmk

Use more elaborate formatting functions:

https://wolfram.com/xid/0mk4k5udp93e-bd9m40

https://wolfram.com/xid/0mk4k5udp93e-cggp96


https://wolfram.com/xid/0mk4k5udp93e-l3s7yb

https://wolfram.com/xid/0mk4k5udp93e-cljxny


https://wolfram.com/xid/0mk4k5udp93e-cqkdbb

https://wolfram.com/xid/0mk4k5udp93e-bjoam1

VertexShape (5)
Use any Graphics, Image or Graphics3D as a vertex shape:

https://wolfram.com/xid/0mk4k5udp93e-dvz661

Specify vertex shapes for individual vertices:

https://wolfram.com/xid/0mk4k5udp93e-i1s9c7

VertexShape can be combined with VertexSize:

https://wolfram.com/xid/0mk4k5udp93e-gsg23u

VertexShape is not affected by VertexStyle:

https://wolfram.com/xid/0mk4k5udp93e-3ef8f

VertexShapeFunction has higher priority than VertexShape:

https://wolfram.com/xid/0mk4k5udp93e-budnxj

VertexShapeFunction (10)
Get a list of built-in collections for VertexShapeFunction:

https://wolfram.com/xid/0mk4k5udp93e-cc7w4d

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

https://wolfram.com/xid/0mk4k5udp93e-kqz1mq


https://wolfram.com/xid/0mk4k5udp93e-hshluc


https://wolfram.com/xid/0mk4k5udp93e-wm2s7

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

https://wolfram.com/xid/0mk4k5udp93e-je3pt2


https://wolfram.com/xid/0mk4k5udp93e-cj5ftp

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

https://wolfram.com/xid/0mk4k5udp93e-f4ea1p


https://wolfram.com/xid/0mk4k5udp93e-bfhgv4


https://wolfram.com/xid/0mk4k5udp93e-fhb0zi

Combine with a default vertex function:

https://wolfram.com/xid/0mk4k5udp93e-fmawhn

Draw vertices using a predefined graphic:

https://wolfram.com/xid/0mk4k5udp93e-6fiu

Draw vertices by running a program:

https://wolfram.com/xid/0mk4k5udp93e-oroxkx

https://wolfram.com/xid/0mk4k5udp93e-lt54lp

VertexShapeFunction can be combined with VertexStyle:

https://wolfram.com/xid/0mk4k5udp93e-c5uihz

https://wolfram.com/xid/0mk4k5udp93e-djz15m

VertexShapeFunction has higher priority than VertexStyle:

https://wolfram.com/xid/0mk4k5udp93e-h9wrh2

https://wolfram.com/xid/0mk4k5udp93e-ir0ry

VertexShapeFunction can be combined with VertexSize:

https://wolfram.com/xid/0mk4k5udp93e-e414xo

VertexShapeFunction has higher priority than VertexShape:

https://wolfram.com/xid/0mk4k5udp93e-lnnzsy

VertexSize (8)
By default, the size of vertices is computed automatically:

https://wolfram.com/xid/0mk4k5udp93e-dsy1ve

Specify the size of all vertices using symbolic vertex size:

https://wolfram.com/xid/0mk4k5udp93e-lskxsr

Use a fraction of the minimum distance between vertex coordinates:

https://wolfram.com/xid/0mk4k5udp93e-3lxk1

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

https://wolfram.com/xid/0mk4k5udp93e-my5omo

Specify size in both the and
directions:

https://wolfram.com/xid/0mk4k5udp93e-c7twgs

Specify the size for individual vertices:

https://wolfram.com/xid/0mk4k5udp93e-h6r4ja

VertexSize can be combined with VertexShapeFunction:

https://wolfram.com/xid/0mk4k5udp93e-b3jw4t

VertexSize can be combined with VertexShape:

https://wolfram.com/xid/0mk4k5udp93e-dego1v

VertexStyle (5)

https://wolfram.com/xid/0mk4k5udp93e-ehbi7i


https://wolfram.com/xid/0mk4k5udp93e-dtkst6

VertexShapeFunction can be combined with VertexStyle:

https://wolfram.com/xid/0mk4k5udp93e-om30z

https://wolfram.com/xid/0mk4k5udp93e-nnfnwx

VertexShapeFunction has higher priority than VertexStyle:

https://wolfram.com/xid/0mk4k5udp93e-kfv4n

https://wolfram.com/xid/0mk4k5udp93e-cldcke

VertexStyle can be combined with BaseStyle:

https://wolfram.com/xid/0mk4k5udp93e-bby1h9

VertexStyle has higher priority than BaseStyle:

https://wolfram.com/xid/0mk4k5udp93e-d0df6

VertexShape is not affected by VertexStyle:

https://wolfram.com/xid/0mk4k5udp93e-3rqw0

VertexWeight (2)
Set the weight for all vertices:

https://wolfram.com/xid/0mk4k5udp93e-coy9ti


https://wolfram.com/xid/0mk4k5udp93e-jjkrix

Use any numeric expression as a weight:

https://wolfram.com/xid/0mk4k5udp93e-lxjpz1


https://wolfram.com/xid/0mk4k5udp93e-ckzgu5

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

https://wolfram.com/xid/0mk4k5udp93e-8i7sk0

https://wolfram.com/xid/0mk4k5udp93e-psy8av

Point to edge sharing the same face:

https://wolfram.com/xid/0mk4k5udp93e-m6cypr


https://wolfram.com/xid/0mk4k5udp93e-uhgklm

https://wolfram.com/xid/0mk4k5udp93e-1ie9bi

Point to edge sharing the same face:

https://wolfram.com/xid/0mk4k5udp93e-rmcb14

Menger mesh connectivity graph:

https://wolfram.com/xid/0mk4k5udp93e-xidgh7


https://wolfram.com/xid/0mk4k5udp93e-whluff

Point to edge sharing the same face:

https://wolfram.com/xid/0mk4k5udp93e-f9qb5k

3D boundary mesh connectivity graph:

https://wolfram.com/xid/0mk4k5udp93e-v9amoc

https://wolfram.com/xid/0mk4k5udp93e-lw3qdm

Point to edge sharing the same face:

https://wolfram.com/xid/0mk4k5udp93e-37osko

Get the face adjacency of a Voronoi mesh:

https://wolfram.com/xid/0mk4k5udp93e-z269wv

https://wolfram.com/xid/0mk4k5udp93e-qm5ujh


https://wolfram.com/xid/0mk4k5udp93e-x5cn4l

https://wolfram.com/xid/0mk4k5udp93e-yb6nel

Adjacency Queries (1)
Use the mesh connectivity graph to find point-point adjacency in a mesh:

https://wolfram.com/xid/0mk4k5udp93e-tpdczz

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

https://wolfram.com/xid/0mk4k5udp93e-h9spzh

Polyhedra Operations (1)
Use MeshConnectivityGraph to compute the DualPolyhedron of a cuboid:

https://wolfram.com/xid/0mk4k5udp93e-57oh0s
Compute the connectivity graph between points and faces:

https://wolfram.com/xid/0mk4k5udp93e-2sevye

Get the adjacent faces for each point:

https://wolfram.com/xid/0mk4k5udp93e-qvq1ka

Compute the coordinates of the dual:

https://wolfram.com/xid/0mk4k5udp93e-7dog75

Construct the dual of the cube:

https://wolfram.com/xid/0mk4k5udp93e-qpgjnm


https://wolfram.com/xid/0mk4k5udp93e-cuq4kg

Topological Operations (3)
Use MeshConnectivityGraph to test whether a mesh is connected:

https://wolfram.com/xid/0mk4k5udp93e-morp8w

https://wolfram.com/xid/0mk4k5udp93e-82fo66

Use MeshConnectivityGraph to compute ConnectedMeshComponents:

https://wolfram.com/xid/0mk4k5udp93e-t3q7i0
Connected components of a mesh connectivity graph:

https://wolfram.com/xid/0mk4k5udp93e-r5d2xr

Group the mesh cells to different mesh connected components:

https://wolfram.com/xid/0mk4k5udp93e-6bhwys

https://wolfram.com/xid/0mk4k5udp93e-qdtxx8

https://wolfram.com/xid/0mk4k5udp93e-t53l1p

Get mesh connected components:

https://wolfram.com/xid/0mk4k5udp93e-ef22kd

-skeleton graph of Platonic solids:

https://wolfram.com/xid/0mk4k5udp93e-xa8uig

Properties & Relations (3)Properties of the function, and connections to other functions
The cell of index {d,k} corresponds to the vertex :

https://wolfram.com/xid/0mk4k5udp93e-ch3hh9


https://wolfram.com/xid/0mk4k5udp93e-36zqlc

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

https://wolfram.com/xid/0mk4k5udp93e-cainbb


https://wolfram.com/xid/0mk4k5udp93e-gawr71


https://wolfram.com/xid/0mk4k5udp93e-9hmi0y

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

https://wolfram.com/xid/0mk4k5udp93e-lzq6tm


https://wolfram.com/xid/0mk4k5udp93e-9he0vm


https://wolfram.com/xid/0mk4k5udp93e-7ni49k

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