public class GraphAlgorithms extends Object
Constructor and Description |
---|
GraphAlgorithms() |
Modifier and Type | Method and Description |
---|---|
static LinkedList<LinkedList<Vertex>> |
dijkstra(Graph graph)
Runs the standard Dijkstra Algorithm on a given
graph . |
static LinkedList<LinkedList<Vertex>> |
dijkstra(Graph graph,
double stepWeight,
double edgeWeight)
Runs a weighted Dijkstra Algorithm on a given
graph . |
static LinkedList<Vertex> |
findConnectedComponent(Graph graph,
Vertex root)
Runs breadth first search on the graph.
|
static LinkedList<Vertex> |
findFastestPath(Graph graph,
Vertex source,
Vertex target)
Runs breadth first search on the graph to find the fastest path
difference to findConnectdComponent is that this algorithm stops when the
target is found
|
static LinkedList<Vertex> |
findSurveyedConnectedComponent(Graph graph,
Vertex root)
Runs breadth first search on the graph.
|
static LinkedList<Vertex> |
getSurrounding(Vertex core)
returns a list of all the neighbours which are at most 2 steps away of
the position. the position itself is not included
|
static LinkedList<LinkedList<Vertex>> |
goTowards(Graph graph) |
static LinkedList<LinkedList<Vertex>> |
goTowards(Graph graph,
double stepWeight,
double edgeWeight,
int maxEdgeCost)
this action is pretty similar to dijkstra() above only difference: it
considers the unsurveyed edges as well, weighting them by 5
|
static LinkedList<LinkedList<Vertex>> |
goTowards(Vertex root,
Graph graph,
double stepWeight,
double edgeWeight)
this method call finds all shortest path from a given Vertex root
|
public static LinkedList<LinkedList<Vertex>> dijkstra(Graph graph)
graph
.graph
- The actually known graph.graph
to
all vertices as a list of lists of edges.public static LinkedList<LinkedList<Vertex>> dijkstra(Graph graph, double stepWeight, double edgeWeight)
graph
.graph
- The actually known graph.stepWeight
- The weight for the number of steps. This is important,
since every goto issue costs a step.edgeWeight
- The weight for the edges weights. This determines the
influence of edge weights.graph
to
all vertices as a list of lists of edges.public static LinkedList<LinkedList<Vertex>> goTowards(Graph graph, double stepWeight, double edgeWeight, int maxEdgeCost)
public static LinkedList<LinkedList<Vertex>> goTowards(Vertex root, Graph graph, double stepWeight, double edgeWeight)
public static LinkedList<LinkedList<Vertex>> goTowards(Graph graph)
public static LinkedList<Vertex> findFastestPath(Graph graph, Vertex source, Vertex target)
graph
- the graphsource
- the source vertextarget
- the target to go topublic static LinkedList<Vertex> findConnectedComponent(Graph graph, Vertex root)
graph
- the graphroot
- the source nodesource
.public static LinkedList<Vertex> findSurveyedConnectedComponent(Graph graph, Vertex root)
graph
- the graphroot
- the source nodesource
.public static LinkedList<Vertex> getSurrounding(Vertex core)
core
- the center vertex.Copyright © 2013. All Rights Reserved.