@@ -76,11 +76,11 @@ The vertices are colored in a greedy fashion, following the `order` supplied.
7676"""
7777function star_coloring (g:: Graph{false} , order:: AbstractOrder )
7878 # Initialize data structures
79- n = nb_vertices (g)
80- color = zeros (Int, n )
81- forbidden_colors = zeros (Int, n )
82- first_neighbor = fill ((0 , 0 ), n ) # at first no neighbors have been encountered
83- treated = zeros (Int, n )
79+ nv = nb_vertices (g)
80+ color = zeros (Int, nv )
81+ forbidden_colors = zeros (Int, nv )
82+ first_neighbor = fill ((0 , 0 ), nv ) # at first no neighbors have been encountered
83+ treated = zeros (Int, nv )
8484 star = Dict {Tuple{Int,Int},Int} ()
8585 hub = Int[]
8686 vertices_in_order = vertices (g, order)
@@ -269,12 +269,12 @@ The vertices are colored in a greedy fashion, following the `order` supplied.
269269"""
270270function acyclic_coloring (g:: Graph{false} , order:: AbstractOrder )
271271 # Initialize data structures
272- n = nb_vertices (g)
273- e = nb_edges (g) ÷ 2 # symmetric sparse matrix with empty diagonal
274- color = zeros (Int, n )
275- forbidden_colors = zeros (Int, n )
276- first_neighbor = fill ((0 , 0 ), n ) # at first no neighbors have been encountered
277- first_visit_to_tree = fill ((0 , 0 ), e )
272+ nv = nb_vertices (g)
273+ ne = nb_edges (g) ÷ 2 # symmetric sparse matrix with empty diagonal
274+ color = zeros (Int, nv )
275+ forbidden_colors = zeros (Int, nv )
276+ first_neighbor = fill ((0 , 0 ), nv ) # at first no neighbors have been encountered
277+ first_visit_to_tree = fill ((0 , 0 ), ne )
278278 forest = DisjointSets {Tuple{Int,Int}} ()
279279 vertices_in_order = vertices (g, order)
280280
0 commit comments