use of org.apache.flink.graph.library.GSASingleSourceShortestPaths in project flink by apache.
the class GatherSumApplyITCase method testSingleSourceShortestPaths.
// --------------------------------------------------------------------------------------------
// Single Source Shortest Path Test
// --------------------------------------------------------------------------------------------
@Test
public void testSingleSourceShortestPaths() throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
Graph<Long, NullValue, Double> inputGraph = Graph.fromDataSet(SingleSourceShortestPathsData.getDefaultEdgeDataSet(env), new InitMapperSSSP(), env);
List<Vertex<Long, Double>> result = inputGraph.run(new GSASingleSourceShortestPaths<Long, NullValue>(1L, 16)).collect();
String expectedResult = "1,0.0\n" + "2,12.0\n" + "3,13.0\n" + "4,47.0\n" + "5,48.0\n";
compareResultAsTuples(result, expectedResult);
}
Aggregations