Expand description
This module provides some utility functions for working with assignments and RLE encoding. It also provides a function to sort a JSON file by a key so as to make the BEN encoding more efficient.
Functionsยง
- assign_
to_ rle - Convert a vector of assignments to a run-length encoded (RLE) vector.
- rle_
to_ vec - Convert a run-length encoded (RLE) vector to a vector of assignments.
- sort_
json_ file_ by_ key - Sorts a JSON-formatted NetworkX graph file by a key. This function will sort the nodes in the graph by the key provided and then relabel the nodes in the graph from 0 to n-1 where n is the number of nodes in the graph. It will also relabel the edges in the graph to match the new node labels.