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.2.tar.gz (9.5 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.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: daag-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 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.2.tar.gz
Algorithm Hash digest
SHA256 09f09f94f226a6e5274ec53099b5bc0a62aa974501bda937825c36e45851f111
MD5 b0ec3400a390141ea5f1dc9e0ef0337d
BLAKE2b-256 a695bd67cae9c59d8b12ada822f3becc5089f5bc6f7a142c4fd7c03c54461c93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: daag-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d2db5339b559c67ce360a584508d462e49e3166cadbc6c4c53dcdf568638879
MD5 47bd6ac58fa7a83f2bf2a5c6164b572d
BLAKE2b-256 b9e4f497296970fa949c0b9726f663ec258d797a9aeaee9297d50c8b7c5cb4fd

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