Skip to main content

A Python package for automated mathematical conjecturing.

Project description

GraffitiAI

GraffitiAI is a Python package for automated mathematical conjecturing, inspired by the legacy of GRAFFITI. It provides tools for exploring relationships between mathematical invariants and properties, with a focus on graph theory and polytopes. This package supports generating conjectures, applying heuristics, and visualizing results.

Features

  • Load and preprocess datasets with ease.
  • Identify possible invariants and hypotheses for conjecturing.
  • Generate upper and lower bounds for a target invariant.
  • Apply customizable heuristics to refine conjectures.
  • Export results to PDF for presentation and sharing.
  • Includes a sample dataset of 3-regular polytopes for experimentation.

Installation

To install GraffitiAI, clone the repository and install the package locally:

# Clone the repository
git clone https://github.com/RandyRDavila/GraffitiAI.git

# Navigate to the directory
cd GraffitiAI

# Install the package
pip install .

Quick Start

Here's a simple example to get you started:

Using the Built-in Dataset

from graffitiai import Optimist

# Initialize the Optimist instance
optimist = Optimist()

# Load the sample dataset
optimist.load_sample_3_regular_polytope_data()

# Describe available invariants and hypotheses
optimist.describe_invariants_and_hypotheses()

# Generate conjectures
optimist.conjecture(
    target_invariant='independence_number',
    other_invariants=['n', 'matching_number'],
    hypothesis=['cubic_polytope'],
    complexity=2,
    show=True
)

# Save conjectures to a PDF
optimist.save_conjectures_to_pdf("conjectures.pdf")

Using a Custom CSV File

from graffitiai import Optimist

# Initialize the Optimist instance
optimist = Optimist()

# Load a custom dataset
optimist.read_csv("path_to_your_data.csv")

# Describe available invariants and hypotheses
optimist.describe_invariants_and_hypotheses()

# Generate conjectures
optimist.conjecture(
    target_invariant='your_target_invariant',
    other_invariants=['invariant1', 'invariant2'],
    hypothesis=['your_hypothesis_column'],
    complexity=2,
    show=True
)

# Save conjectures to a PDF
optimist.save_conjectures_to_pdf("custom_conjectures.pdf")

API Reference

class Optimist

Methods

  1. load_sample_3_regular_polytope_data() Loads the included sample dataset of 3-regular polytopes into the knowledge table.

  2. read_csv(path_to_csv) Loads a dataset from a CSV file, standardizing column names and ensuring compatibility for conjecturing.

  3. get_possible_invariants() Returns a list of numerical columns suitable for conjecturing.

  4. get_possible_hypotheses() Returns a list of boolean columns suitable for hypotheses.

  5. describe_invariants_and_hypotheses() Prints the possible invariants and hypotheses from the knowledge table.

  6. conjecture(target_invariant, other_invariants, hypothesis, complexity=2, show=False, min_touch=0, use_morgan=True, use_smokey=True) Generates conjectures for a given target invariant using the specified invariants and hypotheses.

  7. write_on_the_wall(target_invariants=None) Displays generated conjectures for specified or all target invariants.

  8. save_conjectures_to_pdf(file_name="conjectures.pdf", target_invariants=None) Exports generated conjectures to a PDF file, including the date and time of generation.


Sample Dataset

GraffitiAI includes a sample dataset of 3-regular polytopes. It contains properties such as independence number, domination number, and average shortest path length, among others. This dataset is ideal for experimenting with the package's features.


Contributing

Contributions are welcome! If you have suggestions, find bugs, or want to add features, feel free to create an issue or submit a pull request.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgments

GraffitiAI is inspired by the pioneering work of GRAFFITI and built using the ideas of TxGraffiti.

Author

Randy R. Davila, PhD

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

graffitiai-0.1.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

graffitiai-0.1.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file graffitiai-0.1.1.tar.gz.

File metadata

  • Download URL: graffitiai-0.1.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for graffitiai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5dec14e32cfbb068a90cb1e7f3d93dc82fca94cb1cd65f2db9b4f42cd0f72967
MD5 e2461590949dad324eba2bbb28fae7ea
BLAKE2b-256 6f06d1da74a986ec52eea1a9a337cb0e459504ef9138d066f2e242282d30501e

See more details on using hashes here.

File details

Details for the file graffitiai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: graffitiai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for graffitiai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 96da92bd4d1ce2b661dd5a1d7cbf4e90495e428e9f38d39b2af9f0a02d6d2e59
MD5 f50b10123035f6979ee1ab975476688b
BLAKE2b-256 09a805b108a27e40b8246cb8422c5d37dafb6f6082f4bfe1facac56845f9f373

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