Skip to content

Degree-based orderings, take 2#125

Merged
gdalle merged 21 commits intomainfrom
gd/order
Oct 27, 2024
Merged

Degree-based orderings, take 2#125
gdalle merged 21 commits intomainfrom
gd/order

Conversation

@gdalle
Copy link
Copy Markdown
Member

@gdalle gdalle commented Sep 27, 2024

This PR implements three additional orders from the ColPack paper: SmallestLast, IncidenceDegree, DynamicLargestFirst (new version of #18).

  • Implement degree-based orders for AdjacencyGraph and BipartiteGraph.
  • Test that they return correct results.

The big question is where to find small examples to check that we return the correct orders. This is especially tricky because ties are broken in an arbitrary manner.

@gdalle gdalle mentioned this pull request Sep 27, 2024
8 tasks
@gdalle gdalle changed the title Degree-based orderings Degree-based orderings, take 2 Sep 27, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (74e4497) to head (a4c9274).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #125    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           13        13            
  Lines         1010      1162   +152     
==========================================
+ Hits          1010      1162   +152     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle gdalle marked this pull request as ready for review September 27, 2024 09:59
@gdalle gdalle requested a review from amontoison September 27, 2024 10:00
@amontoison
Copy link
Copy Markdown
Collaborator

amontoison commented Sep 27, 2024

You also implemented DynamicDegreeBasedOrder, right?
Is it described in the ColPack paper?

Update: I checked the code and I need to read again the ColPack paper.

@gdalle
Copy link
Copy Markdown
Member Author

gdalle commented Sep 27, 2024

You also implemented DynamicDegreeBasedOrder, right?

Yeah, basically these three new orders are variants of the same underlying paradigm, which is DynamicDegreeBasedOrder. So we don't need three different implems, just a single one with a few toggles here and there

Base automatically changed from gd/bettergraph to main September 27, 2024 20:27
@amontoison
Copy link
Copy Markdown
Collaborator

amontoison commented Sep 29, 2024

gdalle, what is SaturationDegree in #15?
Is it the missing combination forward + down?

@gdalle
Copy link
Copy Markdown
Member Author

gdalle commented Sep 29, 2024

No, it's a very different one. I just re-read the section of the ColPack paper and I think we can skip it?

Saturation Degree ordering, due to Brélaz [1979], is another known ordering technique for greedy coloring. It can be best viewed in contrast to the ID ordering technique: in a coloring algorithm that uses an ID ordering, the ith vertex is a vertex with the largest number of already colored adjacent vertices, whereas in an algorithm that uses an SD ordering it is a vertex that has the largest number of distinctly colored adjacent vertices. Clearly, the characterization of an SD ordering cannot be separated from the rest of the coloring algorithm, and the ordering is nonamenable for a linear-time implementation in the size of the graph. For these reasons we chose not to include it in ColPack. Turner [1988] has shown that using careful choice of data structures, a coloring algorithm that in effect employs an SD ordering can be implemented such that its complexity is O(|E|log|V|). We have implemented such an algorithm and we will report results on it in the experiments discussed in Section 8.

@gdalle gdalle marked this pull request as draft October 6, 2024 15:08
@gdalle gdalle removed the request for review from amontoison October 7, 2024 15:17
Comment thread src/check.jl
!!! warning
This function is not coded with efficiency in mind, it is designed for small-scale tests.
"""
function valid_dynamic_order(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amontoison this function is the most important one to understand, because the tests rely on it. The actual implementation of the order is just an asymptotically faster way to do what is written below.

@gdalle gdalle marked this pull request as ready for review October 9, 2024 12:29
@gdalle
Copy link
Copy Markdown
Member Author

gdalle commented Oct 23, 2024

@amontoison friendly bump, do you want us to try and merge this one?

@gdalle
Copy link
Copy Markdown
Member Author

gdalle commented Oct 27, 2024

Following our chat with @amontoison, I'm merging this with clear warnings that the new orders are experimental and need further tests. That way we can start experimenting.

@gdalle gdalle merged commit 42622b5 into main Oct 27, 2024
@gdalle gdalle deleted the gd/order branch October 27, 2024 20:27
@gdalle gdalle mentioned this pull request Jan 21, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants