+ delete queue;
+ delete discovered;
+}
+
+/**
+ * Add a CycleNode to the graph, corresponding to a store ModelAction
+ * @param act The write action that should be added
+ * @param node The CycleNode that corresponds to the store
+ */
+void CycleGraph::putNode(const ModelAction *act, CycleNode *node)
+{
+ actionToNode.put(act, node);
+#if SUPPORT_MOD_ORDER_DUMP
+ nodeList.push_back(node);
+#endif
+}
+
+/**
+ * Add a CycleNode to the graph, corresponding to a Promise
+ * @param promise The Promise that should be added
+ * @param node The CycleNode that corresponds to the Promise
+ */
+void CycleGraph::putNode(const Promise *promise, CycleNode *node)
+{
+ promiseToNode.put(promise, node);
+#if SUPPORT_MOD_ORDER_DUMP
+ nodeList.push_back(node);
+#endif
+}
+
+/**
+ * @brief Remove the Promise node from the graph
+ * @param promise The promise to remove from the graph
+ */
+void CycleGraph::erasePromiseNode(const Promise *promise)
+{
+ promiseToNode.put(promise, NULL);
+#if SUPPORT_MOD_ORDER_DUMP
+ /* Remove the promise node from nodeList */
+ CycleNode *node = getNode_noCreate(promise);
+ for (unsigned int i = 0; i < nodeList.size(); )
+ if (nodeList[i] == node)
+ nodeList.erase(nodeList.begin() + i);
+ else
+ i++;
+#endif
+}
+
+/** @return The corresponding CycleNode, if exists; otherwise NULL */
+CycleNode * CycleGraph::getNode_noCreate(const ModelAction *act) const
+{
+ return actionToNode.get(act);
+}
+
+/** @return The corresponding CycleNode, if exists; otherwise NULL */
+CycleNode * CycleGraph::getNode_noCreate(const Promise *promise) const
+{
+ return promiseToNode.get(promise);