Interfaces#
This module implements the Graph interface.
- class otx.api.entities.interfaces.graph_interface.IGraph#
This interface describes how the interface of the Graph looks like.
This interface is used to represent the TaskGraph inside project as well as the label tree inside LabelSchema
- abstract add_edge(node1, node2)#
Add an edge between node1 and node2.
- abstract add_node(node)#
Add node to the graph.
- abstract property edges: OutMultiEdgeView#
Returns the edges in the Graph.
- abstract find_cliques() Iterator[List[dict]] #
Returns cliques in the graph.
- abstract find_in_edges(node) InMultiEdgeView #
Returns the edges coming in to the node.
- abstract find_out_edges(node) OutMultiEdgeView #
Returns the edges coming out of the node.
- abstract has_edge_between(node1, node2)#
Returns whether there is an edge between node1 and node2.
- abstract neighbors(node) List[dict] #
Returns neighbors of node.
- abstract property nodes: NodeView#
Return nodes in the graph.
- abstract num_nodes() int #
Returns number of nodes.
- abstract remove_edges(node1, node2) None #
Removes the edges between two nodes.