futhark-0.25.32: An optimising compiler for a functional, array-oriented language.

Safe Haskell | None
Language | GHC2021

Futhark.Optimise.MemoryBlockMerging.GreedyColoring

Description

Provides a greedy graph-coloring algorithm.

Synopsis

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

# 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.