Skip to main content

Multi-MST

multi_mst is a Python package for generating robust graph representations of high-dimensional data using iterative minimum spanning trees (MSTs). It supports exploratory analysis within the framework of topological data analysis (TDA).

The package constructs MSTs from pairwise distances between datapoints in a multidimensional space. By perturbing the distance matrix slightly and recalculating the MST multiple times, it captures multiple plausible connections between points. The resulting graph (i.e. the aggregate of these MSTs) offers a more stable and interpretable topological structure for visualisation and further analysis.

Installation

pip install simple-multi-mst

If you want to visualise the network within marimo:

pip install simple-multi-mst[visual]

Usage

import simple_multi_mst
import pandas as pd

df = pd.read_csv("http://aida-lab.be/assets/horse.csv").sample(n=200)
m_mst = simple_multi_mst.MultiMST(df, metric="euclidean", iterations=100)
m_mst.run()
m_mst.export()

API

class MultiMST

Creates and aggregates multiple perturbed MSTs from input data.

Constructor

MultiMST(df, cols=[], metric='euclidean', max_amount=0, iterations=10)
  • df: pandas DataFrame with data points
  • cols: list of columns to use (excluding ‘id’)
  • metric: distance metric (passed to scipy.spatial.distance.pdist)
  • max_amount: maximum amount of perturbation applied to the distances
  • iterations: number of MSTs to compute and combine

Methods

  • run(): computes the MSTs and returns the resulting graph as a JSON-serialisable dictionary.
  • export(format='json', base_filename='output'): writes the output graph to a file.
    • format: "json" for single JSON file; "csv" for separate nodes.csv and links.csv

Metadata

Release files for simple-multi-mst 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-multi-mst 0.1.1
File Size Uploaded Provenance
simple_multi_mst-0.1.1.tar.gz 30.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-multi-mst 0.1.1
File Interpreter ABI Platform
simple_multi_mst-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 33.7 kB

Release files / simple_multi_mst-0.1.1.tar.gz

Download URL simple_multi_mst-0.1.1.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
36c53311330ae187ee58182f6a6f5ad30db6a17cc54ce22467e32010a72ed489
BLAKE2b-256 checksum
How to use checksums
d42b289c927ffd72df75f0fcc231b0ea8626727b93fb7194d9635605fd9c9486
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Release files / simple_multi_mst-0.1.1-py3-none-any.whl

Download URL simple_multi_mst-0.1.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bbf2da0be59e80be298d168ce28a34bf90f2913a44716e73ed2a9d3e34368f3
BLAKE2b-256 checksum
How to use checksums
5b01116261b61b04ff181f4e1e5816dc31d7d85867dcb3afafab00b617a005e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Security for simple-multi-mst 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page