src/VertexColoring.Algorithms/ColoringExtensions.cs
/// <summary>
/// Colors graph vertices greedily processing them in ascending order of vertex degree.
/// Variant of <see cref="ColorGreedily(Graph)"/> with another vertex processing order.
/// </summary>
/// <param name="graph">Graph to be colored.</param>
/// <param name="adjacency"><paramref name="graph"/> adjacency to save calculations
/// when doing multiple colorings.</param>
/// <returns>Vertex coloring of provided graph.</returns>
Colors graph vertices greedily processing them in ascending order of vertex degree.
Variant of  with another vertex processing order.
Colors graph vertices greedily processing them in ascending order of vertex degree . Variant of with another vertex processing order .
public static GraphColoring ColorSmallestFirst(this Graph graph, VertexAdjacency adjacency)
        {
            var verticesLf = graph.Vertices
                .Select(v => v.ToDegreeTuple(adjacency))
                .OrderBy(t => t.degree)
                .Select(t => t.vertex)
                .ToImmutableArray();
            return graph.ColorGreedilyWithVertexOrder(verticesLf, adjacency);
        }
public static GraphColoring ColorSmallestFirst ( this Graph graph , VertexAdjacency adjacency ) { var verticesLf = graph . Vertices . Select ( v => v . ToDegreeTuple ( adjacency ) ) . OrderBy ( t => t . degree ) . Select ( t => t . vertex ) . ToImmutableArray ( ) ; return graph . ColorGreedilyWithVertexOrder ( verticesLf , adjacency ) ; }
Colors graph vertices greedily processing them in ascending order of vertex degree.
Colors graph vertices greedily processing them in ascending order of vertex degree .
Vertex coloring of provided graph.
Vertex coloring of provided graph .
Graph
this
adjacency
VertexAdjacency
adjacency to save calculations
when doing multiple colorings.
adjacency to save calculations when doing multiple colorings .
graph
Graph to be colored.
Graph to be colored .