futhark-0.22.1: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.Optimise.MemoryBlockMerging.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.