Skip to main content

A SteinerTree library implementing several huristic and exact steiner methods.

Project description

SteinerNet

The Steiner Tree Approach refers to a method used in graph theory and network design to find the most efficient way to connect a set of points (nodes), potentially using extra intermediate points (called Steiner points) to minimize the total connection cost.

This the python eqiuivalent to SteinerNet in R. Released 10 years later on date the R version was released.

Installation PyPl Total Downloads

To install:

pip install steinernet

You can install the package locally using pip:

pip install .

Or, for development:

pip install -e .

Requirements

  • Python 3.7+
  • networkx

Usage

import networkx as nx
from steinernet import SteinerNet

# Create a sample graph
G = nx.cycle_graph(6)
terminals = [0, 2, 4]

# Initialize SteinerNet
sn = SteinerNet(G)

# Compute a Steiner tree using the random walk method
T = sn.random_walk_tree(terminals, seed=42)

# Visualize the result
import matplotlib.pyplot as plt
nx.draw(T, with_labels=True)
plt.show()

Turorial

Check the Tutorial on tutorial file

Documentation

  • SteinerNet(graph)
    • graph: networkx.Graph, the input undirected graph (optionally weighted)
    • Returns: SteinerNet object
  • SteinerNet.random_walk_tree(terminals, seed=None)
    • terminals: list of node indices to connect
    • seed: (optional) random seed for reproducibility
    • Returns: networkx.Graph, the approximate Steiner tree

Reference

Afshin Sadeghi and Holger Froehlich, "Steiner tree methods for optimal sub-network identification: an empirical study", BMC Bioinformatics 2013 14:144, doi:10.1186/1471-2105-14-144

License

This project is open source under the Apache 2.0 License. You basically can use it in any commercial or research project.

Citation

To use this package in your work, cite this article as:

@article{sadeghi2013steiner,
  title={Steiner tree methods for optimal sub-network identification: an empirical study},
  author={Sadeghi, Afshin and Fr{\"o}hlich, Holger},
  journal={BMC bioinformatics},
  volume={14},
  pages={1--19},
  year={2013},
  publisher={Springer},
  doi = {https://doi.org/10.1186/1471-2105-14-144}
}

Link to R steinerNet repository.

For bug reports contact me at 🔗 LinkedIn

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

steinernet-0.1.2.tar.gz (216.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

steinernet-0.1.2-py3-none-any.whl (149.5 kB view details)

Uploaded Python 3

File details

Details for the file steinernet-0.1.2.tar.gz.

File metadata

  • Download URL: steinernet-0.1.2.tar.gz
  • Upload date:
  • Size: 216.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for steinernet-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f4eec096f901a979ca814ecbd41c76d65917a90a41d6bf5a2121f13a68367e79
MD5 d192ea9754d05aadce25a5122689ebae
BLAKE2b-256 4e14e86994cc915cbaffe9abd34b5c3424be2816bcf76a0f8df78fe52b9f80df

See more details on using hashes here.

File details

Details for the file steinernet-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: steinernet-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 149.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for steinernet-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d5cdfcac019d6256967f5b13b413030f3425dd3da12cf5ffc46f75e165ebce89
MD5 5c3399eb3c4a9a3ef3881007cb8b134c
BLAKE2b-256 9310f890982a8df77bac0505f3a0a02ee8fe669b4b7429410efe1caf3032185f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page