org.apache.flink.graph.examples.data.SingleSourceShortestPathsData Java Examples
The following examples show how to use
org.apache.flink.graph.examples.data.SingleSourceShortestPathsData.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GatherSumApplyITCase.java From flink with Apache License 2.0 | 6 votes |
@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<>(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); }
Example #2
Source File: GatherSumApplyITCase.java From flink with Apache License 2.0 | 6 votes |
@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<>(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); }
Example #3
Source File: GatherSumApplyITCase.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@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<>(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); }
Example #4
Source File: GSASingleSourceShortestPaths.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgeDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .fieldDelimiter("\t") .lineDelimiter("\n") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #5
Source File: SingleSourceShortestPathsITCase.java From flink with Apache License 2.0 | 5 votes |
@Before public void before() throws Exception { resultPath = tempFolder.newFile().toURI().toString(); File edgesFile = tempFolder.newFile(); FileUtils.writeFileUtf8(edgesFile, SingleSourceShortestPathsData.EDGES); edgesPath = edgesFile.toURI().toString(); }
Example #6
Source File: PregelSSSP.java From flink with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgesDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .lineDelimiter("\n") .fieldDelimiter("\t") .ignoreComments("%") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #7
Source File: GSASingleSourceShortestPaths.java From flink with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgeDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .fieldDelimiter("\t") .lineDelimiter("\n") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #8
Source File: SingleSourceShortestPaths.java From flink with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgesDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .lineDelimiter("\n") .fieldDelimiter("\t") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #9
Source File: SingleSourceShortestPathsITCase.java From flink with Apache License 2.0 | 5 votes |
@Before public void before() throws Exception { resultPath = tempFolder.newFile().toURI().toString(); File edgesFile = tempFolder.newFile(); FileUtils.writeFileUtf8(edgesFile, SingleSourceShortestPathsData.EDGES); edgesPath = edgesFile.toURI().toString(); }
Example #10
Source File: PregelSSSP.java From flink with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgesDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .lineDelimiter("\n") .fieldDelimiter("\t") .ignoreComments("%") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #11
Source File: GSASingleSourceShortestPaths.java From flink with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgeDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .fieldDelimiter("\t") .lineDelimiter("\n") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #12
Source File: SingleSourceShortestPaths.java From flink with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgesDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .lineDelimiter("\n") .fieldDelimiter("\t") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #13
Source File: SingleSourceShortestPathsITCase.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Before public void before() throws Exception { resultPath = tempFolder.newFile().toURI().toString(); File edgesFile = tempFolder.newFile(); FileUtils.writeFileUtf8(edgesFile, SingleSourceShortestPathsData.EDGES); edgesPath = edgesFile.toURI().toString(); }
Example #14
Source File: PregelSSSP.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgesDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .lineDelimiter("\n") .fieldDelimiter("\t") .ignoreComments("%") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #15
Source File: SingleSourceShortestPaths.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
private static DataSet<Edge<Long, Double>> getEdgesDataSet(ExecutionEnvironment env) { if (fileOutput) { return env.readCsvFile(edgesInputPath) .lineDelimiter("\n") .fieldDelimiter("\t") .types(Long.class, Long.class, Double.class) .map(new Tuple3ToEdgeMap<>()); } else { return SingleSourceShortestPathsData.getDefaultEdgeDataSet(env); } }
Example #16
Source File: SingleSourceShortestPathsITCase.java From flink with Apache License 2.0 | 4 votes |
@Test public void testSSSPExample() throws Exception { SingleSourceShortestPaths.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }
Example #17
Source File: SingleSourceShortestPathsITCase.java From flink with Apache License 2.0 | 4 votes |
@Test public void testGSASSSPExample() throws Exception { GSASingleSourceShortestPaths.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }
Example #18
Source File: SingleSourceShortestPathsITCase.java From flink with Apache License 2.0 | 4 votes |
@Test public void testPregelSSSPExample() throws Exception { PregelSSSP.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }
Example #19
Source File: SingleSourceShortestPathsITCase.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
@Test public void testPregelSSSPExample() throws Exception { PregelSSSP.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }
Example #20
Source File: SingleSourceShortestPathsITCase.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
@Test public void testGSASSSPExample() throws Exception { GSASingleSourceShortestPaths.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }
Example #21
Source File: SingleSourceShortestPathsITCase.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
@Test public void testSSSPExample() throws Exception { SingleSourceShortestPaths.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }
Example #22
Source File: SingleSourceShortestPathsITCase.java From flink with Apache License 2.0 | 4 votes |
@Test public void testSSSPExample() throws Exception { SingleSourceShortestPaths.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }
Example #23
Source File: SingleSourceShortestPathsITCase.java From flink with Apache License 2.0 | 4 votes |
@Test public void testGSASSSPExample() throws Exception { GSASingleSourceShortestPaths.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }
Example #24
Source File: SingleSourceShortestPathsITCase.java From flink with Apache License 2.0 | 4 votes |
@Test public void testPregelSSSPExample() throws Exception { PregelSSSP.main(new String[]{ SingleSourceShortestPathsData.SRC_VERTEX_ID + "", edgesPath, resultPath, 10 + "" }); expected = SingleSourceShortestPathsData.RESULTED_SINGLE_SOURCE_SHORTEST_PATHS; }