- // TODO: The following is a full-blown graph traversal that we can do if we need to in the future
- // Detect cycles in the current execution/trace
- // We terminate the execution iff:
- // (1) the state has been visited in the current execution
- // (2) the state has one or more cycles that involve all the events
-// private boolean containsCyclesWithAllEvents(int stId) {
-//
-// HashSet<ConflictTracker.Node> visitingStates = new HashSet<>();
-// HashSet<Integer> visitedEvents = new HashSet<>();
-// boolean containsCyclesWithAllEvts = false;
-// ConflictTracker.Node currNode = stateGraph.get(stId);
-// dfsFindCycles(currNode, visitingStates, visitedEvents, new HashSet<>());
-// if (checkIfAllEventsInvolved(visitedEvents)) {
-// containsCyclesWithAllEvts = true;
-// }
-//
-// return containsCyclesWithAllEvts;
-// }
-//
-// private void dfsFindCycles(ConflictTracker.Node currNode, HashSet<ConflictTracker.Node> visitingStates,
-// HashSet<Integer> visitedEvents, HashSet<Integer> visitingEvents) {
-//
-// // Stop when there is a cycle and record all the events
-// if (visitingStates.contains(currNode)) {
-// visitedEvents.addAll(visitingEvents);
-// } else {
-// visitingStates.add(currNode);
-// for(ConflictTracker.Edge edge : currNode.getOutEdges()) {
-// visitingEvents.add(edge.getEventNumber());
-// dfsFindCycles(edge.getDst(), visitingStates, visitedEvents, visitingEvents);
-// visitingEvents.remove(edge.getEventNumber());
-// }
-// visitingStates.remove(currNode);
-// }
-// }
-