Skip to main content

Red Black Graph

Project description

TravisCI Coverage PyPi PyPi Python 3.10 Python 3.9 Python 3.8 Python 3.7 Python 3.6

Red-Black Graph - A DAG of Multiple, Interleaved Binary Trees

Introduction

Red-Black Graphs are a specific type of graph, a directed acyclic graph of interleaved binary trees. This data structure resulted from exploration of efficient representations for family history. This package presents and implements the underlying linear algebra as well as discusses some interesting applications.

This python module extends both scipy and numpy and also conforms to dockerutils conventions for building and running docker images used in module development. There is a script in the bin directory that can be used to setup the project for development or to prep for reading the notebook. (bin/setup-project.sh). You will want to create an activate a virtual environment prior to running the script.

Reading the Notebook

A research paper describing the linear algebra underlying Red-Black graphs as well as examples of application can be found in the Jupyter notebook, "Red Black Graph - A DAG of Multiple, Interleaved Binary Trees.ipynb". To access the notebook after you've setup the project for development, simply:

  • run-image notebook
  • open http://localhost:8888/lab

If you'd prefer to read hard copy, simply run:

`bin/generate-pdf.sh notebooks/Red Black Graph - A DAG of Multiple, Interleaved Binary Trees.ipynb` 

A pdf file will be generated into the build/latex-{datestamped} directory.

To Try Things Out...

Run the following:

# use crawl-fs to extract a sample data set from FamilySearch
pip install fs-crawler
crawl-fs -i <FamilySearch Ids to seed crawl> -o <output-directory> -b <name portion of output file>

# this will generate a <name>.vertices.csv and <name>.edges.csv file which can be ingested into a RedBlackGraph
pip install RedBlackGraph
# use rbgcf to generate both a simple form and cannonical form of a Red Black Graph (xlsx files)
rbgcf -f <directory and base name of vertices and edges file> -o <output-directory>

# Use excel to view output
 

A Note on Implementations

  • redblackgraph.reference - a pure python implementation. This simple implementation is intended primarily for illustrative purposes.
  • redblackgraph.matrix and redblackgrpah.array - a Numpy C-API extension for efficient computation with the matrix multiplication operator, @, overloaded to support avos sum and product.
  • redblackgraph.sparse_matrix - an optimized implementation built on scipy's sparse matrix implementation.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

RedBlackGraph-0.3.17-cp310-cp310-manylinux_2_24_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

RedBlackGraph-0.3.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

RedBlackGraph-0.3.17-cp310-cp310-macosx_11_0_x86_64.whl (619.7 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

RedBlackGraph-0.3.17-cp39-cp39-manylinux_2_24_x86_64.whl (2.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

RedBlackGraph-0.3.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

RedBlackGraph-0.3.17-cp39-cp39-macosx_11_0_x86_64.whl (587.0 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

RedBlackGraph-0.3.17-cp38-cp38-manylinux_2_24_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

RedBlackGraph-0.3.17-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

RedBlackGraph-0.3.17-cp38-cp38-macosx_11_0_x86_64.whl (635.8 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ x86-64

RedBlackGraph-0.3.17-cp37-cp37m-manylinux_2_24_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.24+ x86-64

RedBlackGraph-0.3.17-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

RedBlackGraph-0.3.17-cp37-cp37m-macosx_11_0_x86_64.whl (635.7 kB view hashes)

Uploaded CPython 3.7m macOS 11.0+ x86-64

RedBlackGraph-0.3.17-cp36-cp36m-manylinux_2_24_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.24+ x86-64

RedBlackGraph-0.3.17-cp36-cp36m-macosx_11_0_x86_64.whl (634.4 kB view hashes)

Uploaded CPython 3.6m macOS 11.0+ x86-64

Supported by

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