Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

kmkurn/pyedmond

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyedmond

Edmond's optimal branching algorithm in C++ wrapped by Python. Original version is from https://github.com/xiaohan2012/pyedmond.

As it's in C++ internally, it's faster and more memory-efficient than that of NetworkX.

Example

import numpy as np
from pyedmond import find_minimum_branching

n_nodes, edges = 10, []
weights = np.abs(np.random.rand(n_nodes, n_nodes))
for u in range(n_nodes):
    for v in range(n_nodes):
        if u != v:
            edges.append((u, v, weights[u, v]))

edges = find_minimum_branching(n_nodes, edges, roots=[0, 1])  # returns a list of (int, int) edges

Requirements

  • Boost 1.34 or later
  • Python 3.7 or later

Installation

pip install git+https://github.com/kmkurn/pyedmond.git#egg=pyedmond

License

MIT

Copyright (c) 2017 Han Xiao, 2019 Kemal Kurniawan.

About

Edmonds optimal branching in C++ wrapped by Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 84.6%
  • Python 15.4%