two-color-component ( vertex first-color second-color graph colors -- component )


Vocabulary
compiler.cfg.register-allocation.chordal

Inputs
vertexan object
first-coloran object
second-coloran object
graphan object
colorsan object


Outputs
componentan object


Definition


:: two-color-component
( vertex first-color second-color graph colors -- component )
H{ } clone :> component V{ vertex } clone :> pending
[ pending empty? not ] [
pending pop :> current current component key?
[ ] [
current component conjoin current graph at [|
neighbor |
neighbor colors at :> color color first-color =
color second-color = or [
neighbor component key?
[ ] [ neighbor pending push ] if
] when
] each
] if
] while component ;