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.0.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.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: graffitiai-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 e5ecdd4b52b4643a8f32105e18eecfc10ff361d1a742a30ebaebac2de353292a
MD5 a8f20bc7a559e4b748a792bdc7696d0a
BLAKE2b-256 f8fec0f7fb50c38766d77b819304529d3e18ce775d7e7546ff69d208f6654b0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graffitiai-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54da5e97e02f97de419f0359a1a683fc0f84bc822920f6ad7b65c24a41604d92
MD5 554f358f45565716107e019111b48f05
BLAKE2b-256 581749f1c462617749f07ba5d5137aba2e0ac4b3bbab7468b754692041c185be

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