-
Notifications
You must be signed in to change notification settings - Fork 9
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
Allow non-contiguous layers to be specified simultaneously in force_layer
and force_equal_layers
#43
Merged
Merged
Allow non-contiguous layers to be specified simultaneously in force_layer
and force_equal_layers
#43
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0d67cce
allow non-contiguous layers-specification simultaneously in `force_la…
thchr 69912d3
bump to v0.2.10
thchr da3da9f
Update src/layering.jl
thchr 92fee47
fix-up of commit suggestion
thchr e892aa1
explain a bit more about `force_layer` and layering in doc-string
thchr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "LayeredLayouts" | ||
uuid = "f4a74d36-062a-4d48-97cd-1356bad1de4e" | ||
authors = ["Frames White <[email protected]> and contributors"] | ||
version = "0.2.9" | ||
version = "0.2.10" | ||
|
||
[deps] | ||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+83.8 KB
.../Zarate/direct/disconnected_components_graph_force_layer_force_equal_layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+83.8 KB
...s/Zarate/paths/disconnected_components_graph_force_layer_force_equal_layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note the different time complexity.
This is
O(n*d)
where as the previous code isO(n* log(n))
But it seems we can do better with
Which is only
O(n + d)
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.
Ah, I hadn't thought this. Your suggestion is very nice: I will add that now 👍 !
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.
Would it be more natural to simply make this a
Dict{Int, Vector{Int}}
instead? Then there could also be negative indices and we wouldn't have to potentially store a bunch of empty layers.Maybe there's some assumptions in the code elsewhere that assumes iteration over
layer2nodes
in incrementing fashion?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.
My instinct is that in practical cases the extra costs from empty layers will be lower than the extra cost of needing to do a hash.
Where would we get negative layer indexes? Would that be just from users specifying them by hand?
So it would be a way to say to put this before the natural root layer?
That sounds like a bigger change that would want to be in its own PR
Good question. I don't think so, but i can't from memory rule it out
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.
Agree, better to leave that for a potential follow-up, if ever relevant. Thanks for expeditious merging 👍 !