Tag: 回溯

树结构中的recursion回溯

我有这个algorithm,我想实现一个图search,使用recursion回溯。 首先我的代码: public static boolean buildTree(GenericTreeNode<String> inputNode){ while(!interruptFlag) { try { Thread.sleep(200); } catch(InterruptedException e) {} gui.frame.MainWindow.progress.setText("Iterations Deployment: " + c); gui.panel.ResultMatrix.setResult(mappingList); Multimap<String,String> openList = LinkedHashMultimap.create(); openList = UtilityClasses.getOpenList.getOpenList(dataMap, ApplicationList, HardwareList, mappingList); if(openList.isEmpty() && !mappingList.keySet().containsAll(XMLParser.ApplicationsListGUI)) { gui.frame.MainWindow.labelSuccess.setText("Mapping not succesful!"); return false; } if(openList.isEmpty() && mappingList.keySet().containsAll(XMLParser.ApplicationsListGUI)) { System.out.println(calculateOverallCost.getOverallCosts()); System.out.println("Mapping done:" + " " + mappingList); gui.panel.ResultMatrix.setResult(mappingList); […]