MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / check_cycle

Method check_cycle

KVCOMM/graph/graph.py:430–437  ·  view source on GitHub ↗

Detect if adding edges would create a cycle starting at `new_node`.

(self, new_node, target_nodes)

Source from the content-addressed store, hash-verified

428 node.update_memory_multirequest(message)
429
430 def check_cycle(self, new_node, target_nodes):
431 """Detect if adding edges would create a cycle starting at `new_node`."""
432 if new_node in target_nodes:
433 return True
434 for successor in new_node.spatial_successors:
435 if self.check_cycle(successor, target_nodes):
436 return True
437 return False
438
439 def update_masks(self) -> torch.Tensor:
440 """Return current spatial and temporal mask parameters."""

Calls

no outgoing calls

Tested by

no test coverage detected