class documentation
This class inherits from the Graph class and is used to instantiate cycle graphs. It produces
a 2-edge-colored loopless complete undirected graph in which the edges colored with the color
1 form a cycle graph, while all other edges are colored with the color 0. The vertices are
labeled 0, 1, 2, …, n - 1, where n is the graph order, and two vertices are adjacent if and
only if their labels differ by exactly one modulo n. The graph order n must be at least 3.
The class also allows selecting the initial graph formats in which an instance should be
represented.
| Note | |
| The two bitmask formats can only be used when the graph order is at most 63. |
| Method | __init__ |
This constructor initializes the cycle 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. |
overrides
rlgt.graphs.graph.Graph.__init__This constructor initializes the cycle 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. |
graphint | The graph order, given as a positive int not below 3. |