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

Uploaded Python 3

File details

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

File metadata

  • Download URL: graffitiai-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 31186bbd4a47c2b28a7a36bab87892973ea3c9135b044bb280202d73fa27cc02
MD5 21467aaa81db2263e4095f0c99f735f9
BLAKE2b-256 97198420344cca139720529db1bc8b1afb98e0524d25c291ecc9bb9b01aca5f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graffitiai-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9a6bd0ec14cdb4f5eea3bc5009eef8c9443a7807305037916cd09f21409abb0c
MD5 ca8bd316b4b9d41c189716d5baa1453c
BLAKE2b-256 c0817584e951708bbc405dd8bde924ceef5698b989ad89b746a2d0d736582e2a

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