if Some(true), the code saves storage at the expense of speed by using ConcurrentHashMap instead of Array. If Some(false), chooses Array instead. If None, the code calculates whether the graph is sparse based on the number of nodes and maximum node id.