Get the Bipartite node in the graph by a given internal (unique) id
Get the Bipartite node in the graph by a given internal (unique) id
Checks for a given node, is a graph direction is stored.
Checks for a given node, is a graph direction is stored. e.g., if the node being queries is a left node, and the asked for direction is OutDir, then if the graph's stored direction is LeftToRight or Both, then this function returns true, false otherwise.
NOTE: this data structure could be memory intensive if the max node ID is much larger than the number of elements in the graph, consider using alternative storage. This class represents an array-based bipartite graph. All its nodes are BipartiteNodes. It maintains two types of ID systems: left node ids (< 0) and right node ids (> 0), id value of 0 is not allowed in a Bipartite Graph. Internally it stores two separate arrays, one for left nodes and one for right nodes. The length of the array is the maxNodeId + 1. When a node is being queries, based on the ID value, it converts the ID value to index in the array * (in case of Right, identical; in case of left, the index is id * -1), and retrieves the node object. Edges in the graph fall into two types: from left to right, or from right to left. For example, an edge E that goes from LeftNode A to RightNode B could indicate membership relation. From A's perspective, this is an out-going edge to B, which means A includes B as a member; and similarly from B's perspective, this is an in-coming edge from A, meaning B is included as a member in A. * Another edge E' that goes from B to A, for example, could carry completely different meaning, e.g. followship. From B's perspective, E' is an out-going edge to A, and means that B follows A, and vice versa from A's perspective. E' is an incoming edge, meaning A is followed by B. If a BipartiteGraph is of direction BipartiteLeftToRight or BipartiteRightToLeft, it carries one semantic meaning between the left and right sides; but if the graph is of direction BipartiteBoth, then it could carry two semantic meanings in one graph (e.g. list-to-user membership and user-to-list followship).