Skip to main content

A Python library for creating, visualizing, and manipulating Directed Acyclic Adjacency Graphs - specialized graphs where edges are directed, no cycles are allowed, and edges only connect vertices in adjacent layers.

Project description

DAAG: Directed Acyclic Adjacency Graph

A specialized graph data structure for representing layered dependencies with adjacency constraints.

Overview

The Directed Acyclic Adjacency Graph (DAAG) is a graph structure with the following properties:

  1. Directed: Edges flow in one direction
  2. Acyclic: No cycles are allowed
  3. Adjacency constraint: Edges can only connect vertices in adjacent layers

This makes DAAG particularly useful for modeling dependencies where:

  • Elements are organized in distinct layers/tiers
  • Dependencies can only exist between adjacent layers
  • No circular dependencies are allowed

Features

  • Easy creation and manipulation of layered graph structures
  • Automatic enforcement of adjacency constraints
  • Visualization tools for the full graph and individual subgraphs
  • Interactive filtering to explore complex dependency trees

Basic Usage

from daag import DAAG

# Create a new DAAG
graph = DAAG()

# Add vertices with their respective layers
graph.add_vertex("A", 1)  # Layer 1
graph.add_vertex("B", 2)  # Layer 2
graph.add_vertex("C", 2)  # Also Layer 2
graph.add_vertex("D", 3)  # Layer 3

# Add edges (only allowed between adjacent layers)
graph.add_edge("A", "B")
graph.add_edge("A", "C")
graph.add_edge("B", "D")
graph.add_edge("C", "D")

# Visualize the graph
graph.visualize(filename="my_graph.png")

# Visualize subgraphs for each terminal node
graph.visualize_subgraphs(directory="subgraphs")

# Interactive visualization with filtering
from daag import simple_subgraph_filtering
simple_subgraph_filtering(graph)

Installation

pip install daag

Requirements

  • NetworkX
  • Matplotlib

Documentation

For detailed documentation, see the full technical documentation.

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

daag-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

daag-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file daag-0.1.0.tar.gz.

File metadata

  • Download URL: daag-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for daag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 70c9d0417b2504c0c7532e533cbbf05a3dc2e7d384a0c1f45b2fa570b39d5008
MD5 160774671b970aa5188a867858e43331
BLAKE2b-256 ddcaab623c34afe14c57954aaee103d35b24498c172880aec1a65df8c883aa36

See more details on using hashes here.

File details

Details for the file daag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: daag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for daag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74390e7dd1f1418fd186f855c795ea613efaa11c9bbea7e9a53fcb88ed113061
MD5 d63ba18aa7f0bb854798e9077f411113
BLAKE2b-256 050fb636b3448013f6fbb76086c075aaaba15364e55c91f8d9f01dc17b34609f

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