HP MLIB User's Guide Vol. 2 7th Ed.

Chapter 14 METIS Routines 965
What you need to know to use these routines
Table 14-1 Adjacency-matrix Graph with 5 Vertices
Assuming that vertex numbering starts from 0 (C style), the above (symmetric)
adjacency-matrix indicates that vertex 0 is connected to vertices 1 and 4; vertex
1 is connected to vertices 0, 2, 3, and 4; vertex 2 is connected to vertices 1 and 3;
vertex 3 is connected to vertices 1, 2, and 4; and vertex 4 is connected to vertices
0, 1 and 3.
The adjacency list could be represented in CSR format and C style as:
Optionally weights can be associated to vertices and edges. Consider ncon the
number of weights associated with each vertex, n the number of vertices and m
the number of edges:
vwgt(*)—Integer array of length n x ncon where the weights of the i-th
vertex are stored in ncon consecutive entries starting at location vwgt(i x
ncon). The vertex-weights must be integers greater or equal to zero. If
vwgt( ) is not required, then it can be set to NULL.
adjwgt(*)—Integer array of length 2m where the weight of edge adjncy(j) is
stored at location adjwgt(j). The edge-weights must be integers greater than
zero. If adjwgt( ) is not required, then it can be set to NULL.
Mesh Data Structure
METIS mesh partitioning and mesh conversion routines require the element
node array of a mesh. Consider a mesh with n elements and k nodes per
element (note that since the supported elements in METIS are only triangles,
tetrahedra, hexahedra, and quadrilaterals, the possible values for k are 3, 4, 8,
and 4, respectively):
elmnts(*)—Integer array of length n x k where the k nodes that make up
element i are stored from elmnts(i x k) through and including elmnts((i+1) x
k-1).
01001
10111
01010
01101
11010
xadj=02681114
adjncy=14023413124013