Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1536209eb3 |
2
pom.xml
2
pom.xml
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.btrekkie.connectivity</groupId>
|
||||
<artifactId>dynamic-connectivity</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>0.1.1</version>
|
||||
<name>dynamic-connectivity</name>
|
||||
<description>Data structure for dynamic connectivity in undirected graphs</description>
|
||||
<build>
|
||||
|
||||
@@ -829,17 +829,22 @@ public class ConnGraph {
|
||||
while (levelVertex1 != null) {
|
||||
EulerTourNode root1 = levelVertex1.arbitraryVisit.root();
|
||||
EulerTourNode root2 = levelVertex2.arbitraryVisit.root();
|
||||
EulerTourNode root;
|
||||
if (root1.size < root2.size) {
|
||||
root = root1;
|
||||
} else {
|
||||
root = root2;
|
||||
}
|
||||
|
||||
pushForestEdges(root);
|
||||
replacementEdge = findReplacementEdge(root);
|
||||
if (replacementEdge != null) {
|
||||
break;
|
||||
// Optimization: if hasGraphEdge is false for one of the roots, then there definitely isn't a
|
||||
// replacement edge at this level
|
||||
if (root1.hasGraphEdge && root2.hasGraphEdge) {
|
||||
EulerTourNode root;
|
||||
if (root1.size < root2.size) {
|
||||
root = root1;
|
||||
} else {
|
||||
root = root2;
|
||||
}
|
||||
|
||||
pushForestEdges(root);
|
||||
replacementEdge = findReplacementEdge(root);
|
||||
if (replacementEdge != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// To save space, get rid of trees with one node
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
target/dynamic-connectivity-0.1.1.jar
Normal file
BIN
target/dynamic-connectivity-0.1.1.jar
Normal file
Binary file not shown.
Reference in New Issue
Block a user