OpenQuizz
Une application de gestion des contenus pédagogiques
pip._internal.resolution.resolvelib.resolver Namespace Reference

Data Structures

class  Resolver
 

Functions

def get_topological_weights (graph, expected_node_count)
 

Variables

 Result
 
 logger
 

Function Documentation

◆ get_topological_weights()

def pip._internal.resolution.resolvelib.resolver.get_topological_weights (   graph,
  expected_node_count 
)
Assign weights to each node based on how "deep" they are.

This implementation may change at any point in the future without prior
notice.

We take the length for the longest path to any node from root, ignoring any
paths that contain a single node twice (i.e. cycles). This is done through
a depth-first search through the graph, while keeping track of the path to
the node.

Cycles in the graph result would result in node being revisited while also
being it's own path. In this case, take no action. This helps ensure we
don't get stuck in a cycle.

When assigning weight, the longer path (i.e. larger length) is preferred.

Variable Documentation

◆ logger

logger

◆ Result

Result