public class IslandUtils
extends java.lang.Object
Constructor and Description |
---|
IslandUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsEmpire(java.util.Collection<Island> islands)
Determines if any island in the collection contains an empire.
|
static Path |
findPathBFS(Vertex source,
Vertex sink,
java.util.Set<Vertex> includes) |
static java.util.List<Path> |
getDoublePebblePaths(Island i,
Vertex u,
Vertex v)
Tests to see if using only the vertices in Island i, we can move two pebbles simultaneously to Vertex v.
|
static java.util.HashSet<Island> |
getIslands(PebbleInstance pi) |
static PebbleAlgorithmStates |
isSolvableDiamTwoRec(PebbleInstance pi,
java.util.Set<Vertex> L)
Recursive function that determines if this graph is solvable.
|
static int |
pebbleAlongPath(PebbleInstance pi,
Path path)
Added by CAC 1/09
|
static int |
pebbleAlongPaths(PebbleInstance pi,
java.util.Collection<Path> paths)
Pebble along multiple paths.
|
static int |
pebbleFromIsland(PebbleInstance pi,
Island island,
Vertex v)
Moves a pebble from the island to the vertex, if possible.
|
public static java.util.HashSet<Island> getIslands(PebbleInstance pi)
public static PebbleAlgorithmStates isSolvableDiamTwoRec(PebbleInstance pi, java.util.Set<Vertex> L)
public static int pebbleAlongPaths(PebbleInstance pi, java.util.Collection<Path> paths)
paths
- the collection of pathspublic static int pebbleAlongPath(PebbleInstance pi, Path path)
path
- public static int pebbleFromIsland(PebbleInstance pi, Island island, Vertex v)
island
- the island I'm pebbling fromv
- the vertex I want to pebble topublic static Path findPathBFS(Vertex source, Vertex sink, java.util.Set<Vertex> includes)
public static boolean containsEmpire(java.util.Collection<Island> islands)
islands
- the islandspublic static java.util.List<Path> getDoublePebblePaths(Island i, Vertex u, Vertex v)
i
- the islandu
- the vertex we are attempting to move a pebble tov
- the vertex we are attempting to move a pebble tograph.UnweightedFlow#getVertexDisjointPaths(Set, Set, Set, int)