diff --git a/.classpath b/.classpath index e912f9f2b..e43402fa4 100644 --- a/.classpath +++ b/.classpath @@ -13,18 +13,16 @@ - - - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 552c39646..782ba92b7 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,9 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -11,4 +11,4 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/README.md b/README.md index e6bd52389..cf506d951 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Javadoc documentation. the amount of gold the player can access, or the strongest monster that can reach him. Retrieving the combined augmentation for a connected component takes O(log N) time with high probability. -* Compatible with Java 6.0 and above. +* Compatible with Java 7.0 and above. # Limitations * `ConnGraph` does not directly support augmenting edges. However, this can be @@ -49,3 +49,7 @@ graph.connected(vertex1, vertex3); // Returns true graph.removeEdge(vertex1, vertex2); graph.connected(vertex1, vertex3); // Returns false ``` + +# Documentation +See for API +documentation. diff --git a/optimization_ideas.txt b/optimization_ideas.txt index af60f3573..75bb73110 100644 --- a/optimization_ideas.txt +++ b/optimization_ideas.txt @@ -110,5 +110,5 @@ Thoughts concerning optimization: cluster replacement edges so that they are close to each other in the Euler tour, then random iteration should tend to locate a replacement edge faster than in-order iteration. (If we know from a previously mentioned optimization - that there is probably no replacement edge, the we shouldn't bother to iterate - over the edges in random order.) + that there is probably no replacement edge, then we shouldn't bother to + iterate over the edges in random order.) diff --git a/pom.xml b/pom.xml index 8c90f5273..75d78e64b 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.github.btrekkie.connectivity dynamic-connectivity - 0.1.3 + 0.2.0 dynamic-connectivity Data structure for dynamic connectivity in undirected graphs @@ -27,8 +27,8 @@ maven-compiler-plugin 3.8.0 - 1.6 - 1.6 + 1.7 + 1.7 diff --git a/src/main/java/com/github/btrekkie/connectivity/ConnGraph.java b/src/main/java/com/github/btrekkie/connectivity/ConnGraph.java index d9225011e..5b9aa2ea1 100644 --- a/src/main/java/com/github/btrekkie/connectivity/ConnGraph.java +++ b/src/main/java/com/github/btrekkie/connectivity/ConnGraph.java @@ -61,7 +61,7 @@ import java.util.Map; * vertices' first and last visits. Instead, we have each vertex store a reference to an arbitrary visit to that vertex. * We also maintain edge objects for each of the edges in the Euler tours. Each such edge stores a pointer to the two * visits that precede the traversal of the edge in the Euler tour. These do not change when we perform a reroot. The - * remove edge operation then requires a pointer to the edge object, rather than a pointer to the vertices. Given the + * remove edge operation then requires a pointer to the edge object, rather than pointers to the vertices. Given the * edge object, we can splice out the range of nodes between the two visits that precede the edge. * * Rather than explicitly giving each edge a level number, the level numbers are implicit through links from each level @@ -898,7 +898,7 @@ public class ConnGraph { /** * Returns whether the specified vertices are connected - whether there is a path between them. Returns true if - * vertex1 == vertex2. This method takes O(lg N) time with high probability. + * vertex1 == vertex2. This method takes O(log N) time with high probability. */ public boolean connected(ConnVertex vertex1, ConnVertex vertex2) { if (vertex1 == vertex2) { diff --git a/src/main/java/com/github/btrekkie/connectivity/ConnVertex.java b/src/main/java/com/github/btrekkie/connectivity/ConnVertex.java index f32860958..41d30c836 100644 --- a/src/main/java/com/github/btrekkie/connectivity/ConnVertex.java +++ b/src/main/java/com/github/btrekkie/connectivity/ConnVertex.java @@ -4,10 +4,7 @@ import java.util.Random; /** A vertex in a ConnGraph. See the comments for ConnGraph. */ public class ConnVertex { - /** - * The thread-local random number generator we use by default to set the "hash" field. We could use - * ThreadLocalRandom instead, but ThreadLocalRandom isn't available in Java 6.0 and below. - */ + /** The thread-local random number generator we use by default to set the "hash" field. */ private static final ThreadLocal random = new ThreadLocal() { @Override protected Random initialValue() { diff --git a/target/dynamic-connectivity-0.1.3.jar b/target/dynamic-connectivity-0.1.3.jar deleted file mode 100644 index cf2ff3a83..000000000 Binary files a/target/dynamic-connectivity-0.1.3.jar and /dev/null differ diff --git a/target/dynamic-connectivity-0.1.3-jar-with-dependencies.jar b/target/dynamic-connectivity-0.2.0-jar-with-dependencies.jar similarity index 56% rename from target/dynamic-connectivity-0.1.3-jar-with-dependencies.jar rename to target/dynamic-connectivity-0.2.0-jar-with-dependencies.jar index f7a999fb8..8fcda1fce 100644 Binary files a/target/dynamic-connectivity-0.1.3-jar-with-dependencies.jar and b/target/dynamic-connectivity-0.2.0-jar-with-dependencies.jar differ diff --git a/target/dynamic-connectivity-0.2.0.jar b/target/dynamic-connectivity-0.2.0.jar new file mode 100644 index 000000000..c04274757 Binary files /dev/null and b/target/dynamic-connectivity-0.2.0.jar differ