-
Notifications
You must be signed in to change notification settings - Fork 45
Added acyclic coloring #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The find_edge method has been reverted back to the old version with a worst case running time of O(size of E) where E is the edge set of graph g. The primary reason is that while the function can be optimized by returning a new edge, the ambiguity between which vertex is the source and which one is the destination breaks the disjoint set function as `Edge 1 => 2` is treated differently compared to `Edge 2=>1`.
TODO: add tests for checking condition 2 of acyclic coloring (all cycles of size 3 or more should have atleast 3 colors)
I want to approve this PR just for the artistic drawings, but I'll restrain myself |
Those renderings, A+. |
@pkj-m to be |
A_graph = matrix2graph(_A, partition_by_rows) | ||
color_graph(A_graph,alg) | ||
end | ||
abstract type SparseDiffToolsColoringAlgorithm <: ArrayInterface.ColoringAlgorithm end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this abstract type needed? Maybe the supertype from ArrayInterface is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why we implemented it this way. Maybe @ChrisRackauckas can throw some light over it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @ChrisRackauckas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes it not type piracy
Co-Authored-By: Mathieu Besançon <[email protected]>
Co-Authored-By: Mathieu Besançon <[email protected]>
Co-Authored-By: Mathieu Besançon <[email protected]>
Co-Authored-By: Mathieu Besançon <[email protected]>
@pkj-m some few more comments, then it looks good |
Co-Authored-By: Mathieu Besançon <[email protected]>
Co-Authored-By: Mathieu Besançon <[email protected]>
Co-Authored-By: Mathieu Besançon <[email protected]>
Co-Authored-By: Mathieu Besançon <[email protected]>
@ChrisRackauckas @matbesancon can we merge this now? |
Good to me yes
…On Mon, Aug 26, 2019, 21:44 Pankaj Mishra ***@***.***> wrote:
@ChrisRackauckas <https://github.com/ChrisRackauckas> @matbesancon
<https://github.com/matbesancon> can we merge this now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#60>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2FDMWBEJ4GIJP24PNKGB3QGQXAPANCNFSM4IJ3RQTA>
.
|
Allows user to color graph using acyclic coloring algorithm.
The main difference between acyclic coloring and ordinary distance-1 coloring is that in the case of acyclic coloring, on top of the regular distance-1 coloring condition, there is an added condition that all the cycles in the graph have atleast 3 colors present.
Example to illustrate the difference:

TODO:
firstTreeToVisit
with eitheredge
type or find a more efficient way to identify the specific edge object instead of iterating over all edges#29