MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / expand_single_element

Method expand_single_element

graphlite/src/exec/executor.rs:6537–6565  ·  view source on GitHub ↗

Expand an element for a specific range of occurrences

(
        &self,
        current_path: &[String],
        element: &PathElement,
        path_type: &PathType,
        graph: &Arc<GraphCache>,
        visited_nodes: &mut std::collections::HashSet<St

Source from the content-addressed store, hash-verified

6535
6536 /// Expand an element for a specific range of occurrences
6537 fn expand_single_element(
6538 &self,
6539 current_path: &[String],
6540 element: &PathElement,
6541 path_type: &PathType,
6542 graph: &Arc<GraphCache>,
6543 visited_nodes: &mut std::collections::HashSet<String>,
6544 visited_edges: &mut std::collections::HashSet<String>,
6545 min_count: u32,
6546 max_count: u32,
6547 ) -> Result<Vec<Vec<String>>, ExecutionError> {
6548 let mut result_paths = Vec::new();
6549
6550 // Generate all possible paths from min_count to max_count occurrences
6551 for count in min_count..=max_count {
6552 let paths = self.expand_element_n_times(
6553 current_path,
6554 element,
6555 path_type,
6556 graph,
6557 visited_nodes,
6558 visited_edges,
6559 count,
6560 )?;
6561 result_paths.extend(paths);
6562 }
6563
6564 Ok(result_paths)
6565 }
6566
6567 /// Expand an element exactly n times
6568 fn expand_element_n_times(

Callers 1

Calls 1

Tested by

no test coverage detected