Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

md.python.graph

md.python.graph component defines contracts to perform operations over graph type, and provides few useful tools out from box.

Architecture overview

Architecture overview

Component overview

# Types
NodeType = typing.TypeVar('NodeType', bound=typing.Hashable)
GraphType = typing.Mapping[NodeType, typing.Collection[NodeType]]
GraphPathType = typing.Iterable[NodeType]
TopologicalSortType = typing.Callable[[GraphType[NodeType]], typing.Iterable[NodeType]]

# Implementation 
def topological_sort_ascending(graph: GraphType[NodeType]) -> typing.Iterable[NodeType]: ...

def topological_sort_descending(
    graph: GraphType[NodeType],
    initial_node: typing.Iterable[NodeType] = None
) -> typing.Iterable[NodeType]: ...

def get_paths(graph: GraphType[NodeType], include_subtree: bool = False) -> typing.Tuple[
    typing.List[GraphPathType[NodeType]],
    typing.List[GraphPathType[NodeType]],
]: ...

Install

pip install md.python.graph --index-url https://source.md.land/python/

Read documentation with examples: https://development.md.land/python/md.python.graph/

About

Set of contracts & operations over graph type

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages