otx.api.entities.interfaces.graph_interface#

This module implements the Graph interface.

Classes

IGraph()

This interface describes how the interface of the Graph looks like.

class otx.api.entities.interfaces.graph_interface.IGraph[source]#

Bases: object

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)[source]#

Add an edge between node1 and node2.

abstract add_node(node)[source]#

Add node to the graph.

abstract find_cliques() Iterator[List[dict]][source]#

Returns cliques in the graph.

abstract find_in_edges(node) InMultiEdgeView[source]#

Returns the edges coming in to the node.

abstract find_out_edges(node) OutMultiEdgeView[source]#

Returns the edges coming out of the node.

abstract has_edge_between(node1, node2)[source]#

Returns whether there is an edge between node1 and node2.

abstract neighbors(node) List[dict][source]#

Returns neighbors of node.

abstract num_nodes() int[source]#

Returns number of nodes.

abstract remove_edges(node1, node2) None[source]#

Removes the edges between two nodes.

abstract property edges: OutMultiEdgeView#

Returns the edges in the Graph.

abstract property nodes: NodeView#

Return nodes in the graph.