Documentation
¶
Index ¶
- type Assigner
- func (c *Assigner) AddPreColoredVertex(id string, color int)
- func (c *Assigner) AddUndirectedEdge(srcID, dstID string) error
- func (c *Assigner) AddVertex(id string)
- func (c *Assigner) AssignColors(ctx context.Context, visitor func(vertexID string, color int)) (int, error)
- func (c *Assigner) Close() error
- func (c *Assigner) Graph() *bspgraph.Graph
- func (c *Assigner) SetExecutorFactory(factory bspgraph.ExecutorFactory)
- type VertexStateMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assigner ¶
type Assigner struct {
// contains filtered or unexported fields
}
Assigner implements the greedy Jones/Plassmann algorithm for coloring graphs.
func NewColorAssigner ¶
NewColorAssigner returns a new color Assigner instance.
func (*Assigner) AddPreColoredVertex ¶
AddPreColoredVertex inserts a new vertex with a pre-assigned color.
func (*Assigner) AddUndirectedEdge ¶
AddUndirectedEdge creates an un-directed edge from srcID to dstID.
func (*Assigner) AssignColors ¶
func (c *Assigner) AssignColors(ctx context.Context, visitor func(vertexID string, color int)) (int, error)
AssignColors executes the Jones/Plassmann algorithm on the graph and invokes the user-defined visitor function for each vertex in the graph.
func (*Assigner) SetExecutorFactory ¶
func (c *Assigner) SetExecutorFactory(factory bspgraph.ExecutorFactory)
SetExecutorFactory configures the calculator to use the a custom executor factory when AssignColors is invoked.
type VertexStateMessage ¶
VertexStateMessage is used to advertise the state of a vertex to its neighbors.
func (*VertexStateMessage) Type ¶
func (m *VertexStateMessage) Type() string
Type returns the type of this message.