Skip to content

md-py/md.python.graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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], typing.Iterable[NodeType]]

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

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

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

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

License

Stars

Watchers

Forks

Packages

No packages published

Languages