Increased minimum Java version and updated documentation
This increases the minimum Java version to 7.0, because Maven doesn't like Java 6.0, and it makes assorted improvements to the documentation.
This commit is contained in:
@@ -13,18 +13,16 @@
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <https://btrekkie.github.io/dynamic-connectivity/index.html> for API
|
||||
documentation.
|
||||
|
||||
@@ -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.)
|
||||
|
||||
6
pom.xml
6
pom.xml
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.btrekkie.connectivity</groupId>
|
||||
<artifactId>dynamic-connectivity</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.2.0</version>
|
||||
<name>dynamic-connectivity</name>
|
||||
<description>Data structure for dynamic connectivity in undirected graphs</description>
|
||||
<build>
|
||||
@@ -27,8 +27,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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> random = new ThreadLocal<Random>() {
|
||||
@Override
|
||||
protected Random initialValue() {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
target/dynamic-connectivity-0.2.0.jar
Normal file
BIN
target/dynamic-connectivity-0.2.0.jar
Normal file
Binary file not shown.
Reference in New Issue
Block a user