本文整理匯總了Java中tests.shortestpaths.utils.KspTestScenarios.getSuurballeTarjanScenario方法的典型用法代碼示例。如果您正苦於以下問題:Java KspTestScenarios.getSuurballeTarjanScenario方法的具體用法?Java KspTestScenarios.getSuurballeTarjanScenario怎麽用?Java KspTestScenarios.getSuurballeTarjanScenario使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tests.shortestpaths.utils.KspTestScenarios
的用法示例。
在下文中一共展示了KspTestScenarios.getSuurballeTarjanScenario方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: suurballeTarjanExample
import tests.shortestpaths.utils.KspTestScenarios; //導入方法依賴的package包/類
@Test
public void suurballeTarjanExample() {
KspTestScenario<String, MyLink> scenario = KspTestScenarios
.getSuurballeTarjanScenario();
Graph<String, MyLink> graph = scenario.getGraph();
List<List<MyLink>> solutions = scenario.getSolutions();
String s = scenario.getSource();
String t = scenario.getTarget();
KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
weightTrans);
int k = solutions.size();
List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);
for (int i = 0; i < k; i++)
assertTrue(comparePaths(solutions.get(i), result.get(i)));
}
示例2: suurballeTarjanExample
import tests.shortestpaths.utils.KspTestScenarios; //導入方法依賴的package包/類
@Test
public void suurballeTarjanExample() {
KspTestScenario<String, MyLink> scenario = KspTestScenarios
.getSuurballeTarjanScenario();
Graph<String, MyLink> graph = scenario.getGraph();
List<List<MyLink>> solutions = scenario.getSolutions();
String s = scenario.getSource();
String t = scenario.getTarget();
KShortestPathAlgorithm<String, MyLink> kspAlgo = factory.create(graph,
weightTrans);
int k = solutions.size();
List<List<MyLink>> result = kspAlgo.getShortestPaths(s, t, k);
for (int i = 0; i < k; i++)
assertTrue(comparePaths(solutions.get(i), result.get(i)));
}