# MATCOLORINGGREEDY
Greedy-with-conflict correction based matrix coloring for distance 1 and 2. 


## Notes

These algorithms proceed in two phases -- local coloring and conflict resolution.  The local coloring
tentatively colors all vertices at the distance required given what's known of the global coloring.  Then,
the updated colors are transferred to different processors at distance one.  In the distance one case, each
vertex with nonlocal neighbors is then checked to see if it conforms, with the vertex being
marked for recoloring if its lower weight than its same colored neighbor.  In the distance two case,
each boundary vertex's immediate star is checked for validity of the coloring.  Lower-weight conflict
vertices are marked, and then the conflicts are gathered back on owning processors.  In both cases
this is done until each column has received a valid color.

Supports both distance one and distance two colorings.


## References

- **** -*** Bozdag et al. "A Parallel Distance 2 Graph Coloring Algorithm for Distributed Memory Computers"
HPCC'05 Proceedings of the First international conference on High Performance Computing and Communications



## See Also
 `MatColoringType`, `MatColoringCreate()`, `MatColoring`, `MatColoringSetType()`, `MatColoringType`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/color/impls/greedy/greedy.c.html#MATCOLORINGGREEDY">src/mat/color/impls/greedy/greedy.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/color/impls/greedy/greedy.c)


[Index of all MatOrderings routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
