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, use pip:

# Install GraffitiAI with pip
pip install graffitiai

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.4.tar.gz (14.9 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.4-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: graffitiai-0.1.4.tar.gz
  • Upload date:
  • Size: 14.9 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.4.tar.gz
Algorithm Hash digest
SHA256 e7184353cbf492702cb8bc9dcce97404f2e8747ab25e6cd2a97c44b222922386
MD5 b0f08e56d13e8063cba5e8cdb8114d9a
BLAKE2b-256 c9ca06710e7ba8be6a50a3041ac02da3d7d63ce8ab77934a0733bd15b9bce304

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graffitiai-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8ef8c719db41fa7e88f89383ce130c0a8faa0db1b5450afabc1622f7fe9b945b
MD5 ddab2f39b628b6ce3e555abb70d6ef89
BLAKE2b-256 2db357f4ee886123c2238805fb6ab9a53ca222c8ec9b6938a53447fe6f4d49ae

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