# BossKaMagic
A comprehensive Python package containing AI algorithm implementations including genetic algorithms, propositional logic solvers, and Bayes theorem applications.
## Features
### 🧬 Genetic Algorithms
- **8-Queens Problem Solver**: Genetic algorithm implementation to solve the classic 8-Queens puzzle
- **Traveling Salesman Problem (TSP)**: Genetic algorithm for finding optimal routes
### 🧠Logic & Probability
- **Propositional Logic**: Complete logical operators (AND, OR, NOT, IMPLIES, BICONDITIONAL) with truth tables
- **Logic Solver**: Truth table generation, resolution theorem proving, and DPLL satisfiability checking
- **Bayes Theorem**: Conditional probability calculations and medical diagnosis examples
- **Naive Bayes Classifier**: Simple implementation for classification tasks
## Installation
```bash
pip install bosskamagic
```
## Quick Start
### Genetic Algorithm - 8 Queens
```python
from bosskamagic.eight_queens_genetic import SimpleQueensGA
# Solve 8-Queens problem
solver = SimpleQueensGA()
solution = solver.solve()
print(f"Solution found: {solution}")
```
### Genetic Algorithm - TSP
```python
from bosskamagic.tsp_genetic import City, SimpleTSPGA
# Create cities
cities = [
City("A", 0, 0),
City("B", 1, 2),
City("C", 3, 1),
City("D", 2, 3)
]
# Solve TSP
tsp_solver = SimpleTSPGA(cities)
best_tour, best_distance = tsp_solver.solve()
print(f"Best distance: {best_distance}")
```
### Logical Operators
```python
from bosskamagic.logic_and_bayes import LogicalOperators
# Use logical operators
result = LogicalOperators.AND(True, False)
print(f"True AND False = {result}")
# Print truth tables
LogicalOperators.print_truth_table_basic()
```
### Bayes Theorem
```python
from bosskamagic.logic_and_bayes import BayesTheorem
# Calculate conditional probability
prob = BayesTheorem.conditional_probability(0.8, 0.1, 0.05)
print(f"Posterior probability: {prob}")
# Run medical diagnosis example
BayesTheorem.medical_diagnosis_example()
```
## Modules
- `eight_queens_genetic`: Genetic algorithm for 8-Queens problem
- `tsp_genetic`: Genetic algorithm for Traveling Salesman Problem
- `logic_and_bayes`: Propositional logic and Bayes theorem implementations
## Requirements
- Python >= 3.7
- random2 >= 1.0.1
## License
MIT License
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## Author
Your Name - your.email@example.com
## Keywords
genetic-algorithm, artificial-intelligence, 8-queens, tsp, traveling-salesman, propositional-logic, bayes-theorem, machine-learning
Raw data
{
"_id": null,
"home_page": "https://github.com/yourusername/bosskamagic",
"name": "bosskamagic",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "genetic-algorithm, artificial-intelligence, 8-queens, tsp, traveling-salesman, propositional-logic, bayes-theorem, machine-learning",
"author": "Your Name",
"author_email": "Your Name <your.email@example.com>",
"download_url": "https://files.pythonhosted.org/packages/7a/07/ea3067a60afd89d4e9ef6da89325d5b62c607ba81355a5abe57145099185/bosskamagic-0.1.0.tar.gz",
"platform": null,
"description": "# BossKaMagic\n\nA comprehensive Python package containing AI algorithm implementations including genetic algorithms, propositional logic solvers, and Bayes theorem applications.\n\n## Features\n\n### \ud83e\uddec Genetic Algorithms\n- **8-Queens Problem Solver**: Genetic algorithm implementation to solve the classic 8-Queens puzzle\n- **Traveling Salesman Problem (TSP)**: Genetic algorithm for finding optimal routes\n\n### \ud83e\udde0 Logic & Probability\n- **Propositional Logic**: Complete logical operators (AND, OR, NOT, IMPLIES, BICONDITIONAL) with truth tables\n- **Logic Solver**: Truth table generation, resolution theorem proving, and DPLL satisfiability checking\n- **Bayes Theorem**: Conditional probability calculations and medical diagnosis examples\n- **Naive Bayes Classifier**: Simple implementation for classification tasks\n\n## Installation\n\n```bash\npip install bosskamagic\n```\n\n## Quick Start\n\n### Genetic Algorithm - 8 Queens\n\n```python\nfrom bosskamagic.eight_queens_genetic import SimpleQueensGA\n\n# Solve 8-Queens problem\nsolver = SimpleQueensGA()\nsolution = solver.solve()\nprint(f\"Solution found: {solution}\")\n```\n\n### Genetic Algorithm - TSP\n\n```python\nfrom bosskamagic.tsp_genetic import City, SimpleTSPGA\n\n# Create cities\ncities = [\n City(\"A\", 0, 0),\n City(\"B\", 1, 2),\n City(\"C\", 3, 1),\n City(\"D\", 2, 3)\n]\n\n# Solve TSP\ntsp_solver = SimpleTSPGA(cities)\nbest_tour, best_distance = tsp_solver.solve()\nprint(f\"Best distance: {best_distance}\")\n```\n\n### Logical Operators\n\n```python\nfrom bosskamagic.logic_and_bayes import LogicalOperators\n\n# Use logical operators\nresult = LogicalOperators.AND(True, False)\nprint(f\"True AND False = {result}\")\n\n# Print truth tables\nLogicalOperators.print_truth_table_basic()\n```\n\n### Bayes Theorem\n\n```python\nfrom bosskamagic.logic_and_bayes import BayesTheorem\n\n# Calculate conditional probability\nprob = BayesTheorem.conditional_probability(0.8, 0.1, 0.05)\nprint(f\"Posterior probability: {prob}\")\n\n# Run medical diagnosis example\nBayesTheorem.medical_diagnosis_example()\n```\n\n## Modules\n\n- `eight_queens_genetic`: Genetic algorithm for 8-Queens problem\n- `tsp_genetic`: Genetic algorithm for Traveling Salesman Problem\n- `logic_and_bayes`: Propositional logic and Bayes theorem implementations\n\n## Requirements\n\n- Python >= 3.7\n- random2 >= 1.0.1\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Author\n\nYour Name - your.email@example.com\n\n## Keywords\n\ngenetic-algorithm, artificial-intelligence, 8-queens, tsp, traveling-salesman, propositional-logic, bayes-theorem, machine-learning\n",
"bugtrack_url": null,
"license": null,
"summary": "AI algorithms collection: Genetic algorithms for 8-Queens and TSP, plus propositional logic and Bayes theorem implementations",
"version": "0.1.0",
"project_urls": {
"Bug Reports": "https://github.com/yourusername/bosskamagic/issues",
"Homepage": "https://github.com/yourusername/bosskamagic",
"Source": "https://github.com/yourusername/bosskamagic"
},
"split_keywords": [
"genetic-algorithm",
" artificial-intelligence",
" 8-queens",
" tsp",
" traveling-salesman",
" propositional-logic",
" bayes-theorem",
" machine-learning"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5aa5850d3fa2c55f652257d8737ab89fed3ee626a5d3c3ddc32e1865ea026a8a",
"md5": "dea260ecbda59eab6cc526b61a1f29e1",
"sha256": "832a6e083777c6b679c5627c353e58d814a92130e46b3b020149c7a9102f7708"
},
"downloads": -1,
"filename": "bosskamagic-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dea260ecbda59eab6cc526b61a1f29e1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 12224,
"upload_time": "2025-08-19T12:46:55",
"upload_time_iso_8601": "2025-08-19T12:46:55.088275Z",
"url": "https://files.pythonhosted.org/packages/5a/a5/850d3fa2c55f652257d8737ab89fed3ee626a5d3c3ddc32e1865ea026a8a/bosskamagic-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7a07ea3067a60afd89d4e9ef6da89325d5b62c607ba81355a5abe57145099185",
"md5": "3967fb4754d258d3ab780ba643ec7e36",
"sha256": "638e62b2614a09a5861230a3981ed60046b57dd8b7ae7823cbfe957a44c96b69"
},
"downloads": -1,
"filename": "bosskamagic-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3967fb4754d258d3ab780ba643ec7e36",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 12428,
"upload_time": "2025-08-19T12:46:56",
"upload_time_iso_8601": "2025-08-19T12:46:56.312845Z",
"url": "https://files.pythonhosted.org/packages/7a/07/ea3067a60afd89d4e9ef6da89325d5b62c607ba81355a5abe57145099185/bosskamagic-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-19 12:46:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "bosskamagic",
"github_not_found": true,
"lcname": "bosskamagic"
}