Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit be50d36

Browse files
committed
general fixes
1 parent c32a1a4 commit be50d36

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/coloring/greedy_star1_coloring.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
no two vertices connected by an edge have the same
66
color using greedy approach. The number of colors
77
used may be equal or greater than the chromatic
8-
number χ(G) of the graph.
8+
number `χ(G)` of the graph.
99
1010
A star coloring is a special type of distance - 1 coloring,
1111
For a coloring to be called a star coloring, it must satisfy
@@ -19,27 +19,27 @@
1919
In other words, every path on four vertices uses at least three
2020
colors.
2121
22-
reference: What Color is your Jacobian?, pg 662
22+
Reference: Gebremedhin AH, Manne F, Pothen A. **What color is your Jacobian? Graph coloring for computing derivatives.** SIAM review. 2005;47(4):629-705.
2323
"""
24-
function greedy_star1_coloring(G::VSafeGraph)
25-
V = nv(G)
26-
color = zeros(Int64, V)
24+
function greedy_star1_coloring(g::LightGraphs.AbstractGraph)
25+
v = nv(g)
26+
color = zeros(Int64, v)
2727

28-
forbiddenColors = zeros(Int64, V+1)
28+
forbiddenColors = zeros(Int64, v+1)
2929

30-
for vertex_i = 1:V
30+
for vertex_i = vertices(g)
3131

32-
for w in inneighbors(G, vertex_i)
32+
for w in inneighbors(g, vertex_i)
3333
if color[w] != 0
3434
forbiddenColors[color[w]] = vertex_i
3535
end
3636

37-
for x in inneighbors(G, w)
37+
for x in inneighbors(g, w)
3838
if color[x] != 0
3939
if color[w] == 0
4040
forbiddenColors[color[x]] = vertex_i
4141
else
42-
for y in inneighbors(G, x)
42+
for y in inneighbors(g, x)
4343
if color[y] != 0
4444
if y != w && color[y] == color[w]
4545
forbiddenColors[color[x]] = vertex_i

src/coloring/greedy_star2_coloring.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
no two vertices connected by an edge have the same
66
color using greedy approach. The number of colors
77
used may be equal or greater than the chromatic
8-
number χ(G) of the graph.
8+
number `χ(G)` of the graph.
99
1010
A star coloring is a special type of distance - 1 coloring,
1111
For a coloring to be called a star coloring, it must satisfy
@@ -19,25 +19,25 @@
1919
In other words, every path on four vertices uses at least three
2020
colors.
2121
22-
reference: What Color is your Jacobian?, pg 663
22+
Reference: Gebremedhin AH, Manne F, Pothen A. **What color is your Jacobian? Graph coloring for computing derivatives.** SIAM review. 2005;47(4):629-705.
2323
2424
TODO: add text explaining the difference between star1 and
2525
star2
2626
"""
27-
function greedy_star2_coloring(G::VSafeGraph)
28-
V = nv(G)
29-
color = zeros(Int64, V)
27+
function greedy_star2_coloring(G::LightGraphs.AbstractGraph)
28+
v = nv(g)
29+
color = zeros(Int64, v)
3030

31-
forbiddenColors = zeros(Int64, V+1)
31+
forbiddenColors = zeros(Int64, v+1)
3232

33-
for vertex_i = 1:V
33+
for vertex_i = vertices(g)
3434

35-
for w in inneighbors(G, vertex_i)
35+
for w in inneighbors(g, vertex_i)
3636
if color[w] != 0
3737
forbiddenColors[color[w]] = vertex_i
3838
end
3939

40-
for x in inneighbors(G, w)
40+
for x in inneighbors(g, w)
4141
if color[x] != 0
4242
if color[w] == 0
4343
forbiddenColors[color[x]] = vertex_i

0 commit comments

Comments
 (0)