futhark-0.19.7: An optimising compiler for a functional, array-oriented language.
Safe HaskellNone
LanguageHaskell2010

Futhark.Optimise.ReuseAllocations.GreedyColoring

Description

Provides a greedy graph-coloring algorithm.

Synopsis

Documentation

colorGraph :: (Ord a, Ord space) => Map a space -> Graph a -> (Map Int space, Coloring a) Source #

Graph coloring that takes into account the space of values. Two values can only share the same color if they live in the same space. The result is map from each color to a space and a map from each value in the input graph to it's new color.

type Coloring a = Map a Int Source #

A map of values to their color, identified by an integer.