From: Thomas Walker Lynch
Date: Fri, 4 Oct 2024 08:45:26 +0000 (+0000)
Subject: more extraction of the depency graph tool
X-Git-Url: https://git.reasoningtechnology.com/usr/lib/python2.7/sre_constants.py?a=commitdiff_plain;h=67f403fa1ca7d1bbb62122f1979c2672ccb9add6;p=GQL-to-Cypher
more extraction of the depency graph tool
---
diff --git a/developer/document/cycle_dection.html b/developer/document/cycle_dection.html
deleted file mode 100644
index 3c9fb85..0000000
--- a/developer/document/cycle_dection.html
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
- Dependency Build Algorithm
-
-
-
- Cycle Detection in Dependency Graph
- Overview
-
- The is_acyclic_q function is designed to detect cycles in a dependency graph using a depth-first search (DFS) algorithm. It starts from a list of root node labels and traverses the graph to ensure that there are no cycles. If a cycle is detected, the function marks the nodes involved and continues to explore other parts of the graph.
-
- Key Concepts
-
- - Dependency Graph: A graph where nodes represent build targets and edges represent dependencies between these targets.
- - Depth-First Search (DFS): An algorithm for traversing or searching tree or graph data structures. It starts at the root and explores as far as possible along each branch before backtracking.
- - Cycle Detection: The process of identifying cycles (loops) in a graph, where a cycle is a path that starts and ends at the same node.
-
- Functions
- 1. is_acyclic_q
-
- Purpose: To determine if the dependency graph is acyclic (i.e., contains no cycles).
-
-
- Parameters:
-
- root_node_labels: A list of labels for the root nodes to start the cycle search.
- verbose: A boolean flag for enabling detailed output (default is true).
-
-
-
- Returns:
-
- 'acyclic' if no cycles are found.
- 'cycle_found' if cycles are detected.
-
-
-
- Process:
-
- - Initializes a stack for DFS traversal.
- - Iteratively calls the
is_acyclic_q_descend function to traverse the graph and detect cycles.
- - Updates the traversal state and continues exploring other paths until the stack is empty.
-
-
- 2. is_acyclic_q_descend
-
- Purpose: To perform the actual DFS traversal and cycle detection for a given path.
-
-
- Parameters:
-
- path_stack: A stack representing the current path in the graph.
- verbose: A boolean flag for enabling detailed output (default is true).
-
-
-
- Returns:
-
- 'leaf_node' if the current node has no children.
- 'cycle_found' if a cycle is detected.
-
-
-
- Process:
-
- - Collects the current path and node.
- - Checks for cycles by comparing the current node with nodes in the path.
- - Marks nodes involved in cycles and updates the stack to continue traversal.
-
-
- Usage
-
- The is_acyclic_q function is used to ensure that the dependency graph defined in the build file is free of cycles. This is crucial for preventing infinite loops and ensuring that the build process can proceed smoothly.
-
-
-
diff --git a/developer/document/dependency_graph.html b/developer/document/dependency_graph.html
deleted file mode 100644
index 378c52d..0000000
--- a/developer/document/dependency_graph.html
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
- Dependency Build Algorithm
-
-
-
- Cycle Detection in Dependency Graph
- Overview
-
- The is_acyclic_q function is designed to detect cycles in a dependency graph using a depth-first search (DFS) algorithm. It starts from a list of root node labels and traverses the graph to ensure that there are no cycles. If a cycle is detected, the function marks the nodes involved and continues to explore other parts of the graph.
-
- Key Concepts
-
- - Dependency Graph: A graph where nodes represent build targets and edges represent dependencies between these targets.
- - Depth-First Search (DFS): An algorithm for traversing or searching tree or graph data structures. It starts at the root and explores as far as possible along each branch before backtracking.
- - Cycle Detection: The process of identifying cycles (loops) in a graph, where a cycle is a path that starts and ends at the same node.
-
- Functions
- 1. is_acyclic_q
-
- Purpose: To determine if the dependency graph is acyclic (i.e., contains no cycles).
-
-
- Parameters:
-
- root_node_labels: A list of labels for the root nodes to start the cycle search.
- verbose: A boolean flag for enabling detailed output (default is true).
-
-
-
- Returns:
-
- 'acyclic' if no cycles are found.
- 'cycle_found' if cycles are detected.
-
-
-
- Process:
-
- - Initializes a stack for DFS traversal.
- - Iteratively calls the
is_acyclic_q_descend function to traverse the graph and detect cycles.
- - Updates the traversal state and continues exploring other paths until the stack is empty.
-
-
- 2. is_acyclic_q_descend
-
- Purpose: To perform the actual DFS traversal and cycle detection for a given path.
-
-
- Parameters:
-
- path_stack: A stack representing the current path in the graph.
- verbose: A boolean flag for enabling detailed output (default is true).
-
-
-
- Returns:
-
- 'leaf_node' if the current node has no children.
- 'cycle_found' if a cycle is detected.
-
-
-
- Process:
-
- - Collects the current path and node.
- - Checks for cycles by comparing the current node with nodes in the path.
- - Marks nodes involved in cycles and updates the stack to continue traversal.
-
-
- Usage
-
- The is_acyclic_q function is used to ensure that the dependency graph defined in the build file is free of cycles. This is crucial for preventing infinite loops and ensuring that the build process can proceed smoothly.
-
-
-
-
-
-2. Run Build Scripts
-
- - Traverse the queue starting from the tail (the most recently added nodes).
- - For each node, attempt to build it by checking the file dates of the target node and its dependencies:
-
- - If the target file is older than any dependency, execute the nodeâs build function.
- - After building, recheck the file dates. If the file date has been updated, mark the node as successfully built.
- - If the build fails or the file date is not updated, mark the node with an error in its property list.
-
-
- - Nodes with dependencies marked with errors will not be built, and errors will propagate up the dependency tree.
-
-
-3. Final Reporting and Status
-
- - If the root node is successfully built, report the success and any other successfully built nodes.
- - If an error has propagated to the root, report the failure.
- - Keep a list of all successfully built nodes and provide a final summary of the build status.
-
-
-4. Node Definitions
-Each node in the dependency graph is defined by a property dictionary. A node is either a symbol or a path:
-
- - Symbol Nodes: These represent abstract concepts or commands and always trigger a build unless marked with an error.
- - Path Nodes: These represent file paths. A path node is considered built if its target file is newer than its dependencies.
-
-Both node types are identified by a label, and their dependencies are stored as a list of node labels. The presence of an error property indicates that the node has failed to build or encountered a problem during processing.
-
-