SimpleComputeGraph

class SimpleComputeGraph(nodesInit: List<GraphNode> = emptyList(), edgesInit: List<GraphEdge> = emptyList()) : ComputeGraph(source)

Minimal production ComputeGraph implementation for tape-based recording path. This mirrors the behavior of the test DefaultComputeGraph but is simplified.

Constructors

Link copied to clipboard
constructor(nodesInit: List<GraphNode> = emptyList(), edgesInit: List<GraphEdge> = emptyList())

Properties

Link copied to clipboard
open override val edges: List<GraphEdge>

All edges in the graph

Link copied to clipboard
open override val nodes: List<GraphNode>

All nodes in the graph

Functions

Link copied to clipboard
open override fun addEdge(edge: GraphEdge): GraphEdge

Adds a new edge connecting two nodes

Link copied to clipboard
open override fun addNode(node: GraphNode): GraphNode

Adds a new node to the graph

Link copied to clipboard
open override fun clear()

Clears all nodes and edges

Link copied to clipboard
open override fun copy(): ComputeGraph

Creates a copy of this graph

Link copied to clipboard
open override fun getInputNodes(): List<GraphNode>

Gets all input nodes (nodes with no incoming edges)

open override fun getInputNodes(node: GraphNode): List<GraphNode>

Gets nodes that are inputs to the given node

Link copied to clipboard
open override fun getOutputNodes(): List<GraphNode>

Gets all output nodes (nodes with no outgoing edges)

open override fun getOutputNodes(node: GraphNode): List<GraphNode>

Gets nodes that receive output from the given node

Link copied to clipboard
open override fun getTopologicalOrder(): List<GraphNode>

Returns nodes in topological order for execution

Link copied to clipboard
open override fun removeEdge(edge: GraphEdge): Boolean

Removes an edge from the graph

Link copied to clipboard
open override fun removeNode(node: GraphNode): Boolean

Removes a node and all connected edges from the graph

Link copied to clipboard
open override fun validate(): ValidationResult

Validates the graph structure (checks for cycles, etc.)