class CompleteKPartiteGraph(Graph):
Constructor: CompleteKPartiteGraph(graph_formats, partition_sizes)
This class inherits from the Graph class and is used to instantiate complete k-partite
graphs. Specifically, it produces a 2-edge-colored loopless complete undirected graph in which
the edges colored with color 1 form a complete k-partite graph, while all remaining edges are
colored with color 0. The vertex set is partitioned into k parts. The first a1 vertices
form the first partition set, the next a2 vertices form the second partition set, and so on,
with the final ak vertices forming the k-th partition set. The parameters k and a1,
a2, …, ak are determined by the list of partition sizes provided at construction time.
The instance can be initialized in selected graph formats. Only the bitmask formats and the
adjacency matrix formats are supported; any flattened formats provided are ignored.
| Method | __init__ |
This constructor initializes the complete k-partite graph in the selected graph formats. |
Inherited from Graph:
| Class Method | from |
This class method initializes a Graph object in either the adjacency matrix format with color numbers or the adjacency matrix format with binary slices. |
| Class Method | from |
This class method initializes a Graph object in either the bitmask format for the out-neighborhoods or the bitmask format for the in-neighborhoods. |
| Class Method | from |
This class method initializes a Graph object in exactly one of the four possible flattened graph formats. |
| Method | __getitem__ |
This method returns the graph at the given index if this object models a batch of graphs. If this object models a single graph, it raises an IndexError. |
| Property | adjacency |
This property returns the numpy.ndarray of type numpy.uint8 representing the given graph or batch of graphs in the adjacency matrix format with binary slices. |
| Property | adjacency |
This property returns the numpy.ndarray of type numpy.uint8 representing the given graph or batch of graphs in the adjacency matrix format with color numbers. |
| Property | allow |
This property returns a bool indicating whether loops are allowed in the given graph or in each graph in the batch. The value True indicates that loops are allowed. |
| Property | batch |
This property returns None if the object represents a single k-edge-colored looped complete graph. If the object represents a batch of k-edge-colored looped complete graphs of the same order, then this property returns the batch size, i... |
| Property | bitmask |
This property returns the numpy.ndarray of type numpy.uint64 representing the given graph or batch of graphs in the bitmask format for the the in-neighborhoods. |
| Property | bitmask |
This property returns the numpy.ndarray of type numpy.uint64 representing the given graph or batch of graphs in the bitmask format for the out-neighborhoods. |
| Property | edge |
This property returns the number of proper edge colors in the given graph or batch of graphs, i.e., k, as a positive int that is at least 2. |
| Property | flattened |
This property returns the numpy.ndarray of type numpy.uint8 representing the given graph or batch of graphs in the flattened clockwise format with binary slices. |
| Property | flattened |
This property returns the numpy.ndarray of type numpy.uint8 representing the given graph or batch of graphs in the flattened clockwise format with color numbers. |
| Property | flattened |
This property returns the numpy.ndarray of type numpy.uint8 representing the given graph or batch of graphs in the flattened row-major format with binary slices. |
| Property | flattened |
This property returns the numpy.ndarray of type numpy.uint8 representing the given graph or batch of graphs in the flattened row-major format with color numbers. |
| Property | graph |
This property returns the order of the given graph or the common order of all graphs in the batch, as a positive int. |
| Property | is |
This property returns a bool indicating whether the given graph or each graph in the batch is directed. The value True indicates that the graph or graphs are directed. |
| Method | __convert |
This private method performs a direct conversion from the format representation of the given graph or batch of graphs in a selected input format to the format representation of that graph or batch of graphs in a selected output format... |
| Instance Variable | __adjacency |
Either a numpy.ndarray of type numpy.uint8 representing the graph structure in the adjacency matrix format with binary slices, if this format was used during initialization or computed afterwards, or None... |
| Instance Variable | __adjacency |
Either a numpy.ndarray of type numpy.uint8 representing the graph structure in the adjacency matrix format with color numbers, if this format was used during initialization or computed afterwards, or None... |
| Instance Variable | __allow |
A bool indicating whether the graph or each graph in the batch is allowed to have loops. If loops are not allowed, then all loops are removed from the considered looped complete graph or graphs and therefore do not exist. |
| Instance Variable | __batch |
Either None, if the object models a single graph, or a positive int, if the object models a batch of graphs, specifying the batch size, i.e., the number of graphs in the batch. |
| Instance Variable | __bitmask |
Either a numpy.ndarray of type numpy.uint64 representing the graph structure in the bitmask format for the in-neighborhoods, if this format was used during initialization or computed afterwards, or None... |
| Instance Variable | __bitmask |
Either a numpy.ndarray of type numpy.uint64 representing the graph structure in the bitmask format for the out-neighborhoods, if this format was used during initialization or computed afterwards, or None... |
| Instance Variable | __edge |
The number of proper edge colors, i.e., k, given as a positive int that is at least 2. |
| Instance Variable | __flattened |
Either a numpy.ndarray of type numpy.uint8 representing the graph structure in the flattened clockwise format with binary slices, if this format was used during initialization or computed afterwards, or ... |
| Instance Variable | __flattened |
Either a numpy.ndarray of type numpy.uint8 representing the graph structure in the flattened clockwise format with color numbers, if this format was used during initialization or computed afterwards, or ... |
| Instance Variable | __flattened |
Either a numpy.ndarray of type numpy.uint8 representing the graph structure in the flattened row-major format with binary slices, if this format was used during initialization or computed afterwards, or ... |
| Instance Variable | __flattened |
Either a numpy.ndarray of type numpy.uint8 representing the graph structure in the flattened row-major format with color numbers, if this format was used during initialization or computed afterwards, or ... |
| Instance Variable | __graph |
The graph order or the common order of all graphs in the batch, given as a positive int. |
| Instance Variable | __is |
A bool indicating whether the graph or each graph in the batch is a k-edge-colored looped complete directed graph or a k-edge-colored looped complete undirected graph. |
rlgt.graphs.graph.Graph.__init__This constructor initializes the complete k-partite graph in the selected graph formats.
| Parameters | |
graphset[ | A nonempty set of GraphFormat items that determines which graph
formats the graph should be initialized in. The set must contain at least one bitmask
format or adjacency matrix format. Any flattened formats in the set are ignored. |
partitionlist[ | A nonempty list of nonnegative int values a1, a2, …, ak,
where k ≥ 1. These values specify the sizes of the partition sets, and their sum,
which equals the graph order, must be at least 1. |