:orphan:
# MatPartitioningSetAdjacency
Sets the adjacency graph (matrix) of the thing to be partitioned.
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatPartitioningSetAdjacency(MatPartitioning part, Mat adj)
```
Collective
## Input Parameters
- ***part -*** the partitioning context
- ***adj -*** the adjacency matrix, this can be any `MatType` but the natural representation is `MATMPIADJ`
## See Also
[](ch_matrices), `Mat`, `MatPartitioning`, `MatPartitioningType`, `MatPartitioningCreate()`
## Level
beginner
## Location
src/mat/partition/partition.c
## Examples
src/ksp/ksp/tutorials/ex64.c
src/mat/tutorials/ex11.c
src/mat/tutorials/ex15.c
src/mat/tutorials/ex15f.F90
src/mat/tutorials/ex17.c
src/mat/tutorials/ex17f.F90
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/partition/partition.c)
[Index of all MatOrderings routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)