Skip to content

Generate a Hasse diagram for the power set P(𝑆) of a given set 𝑆={π‘Ž,𝑏,𝑐} using NetworkX in Python.

Notifications You must be signed in to change notification settings

ShiiiivanshSingh/Hasse-Diagrams-Using-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Hasse Diagrams Using Python πŸ“š

cause i hate myself ✨ and why not.
Generate a Hasse diagram for the power set P(𝑆) of a given set 𝑆={π‘Ž,𝑏,𝑐} using NetworkX in Python.

VIDEO Demonstartion

🌐 LINK

Project Overview πŸ“œ

This project visualizes the subset inclusion relationships in 𝑃(𝑆) the power set of 𝑆={π‘Ž,𝑏,𝑐} using a Hasse diagram. Hasse diagrams are helpful for visualizing partially ordered sets (posets) where elements are linked by subset relations.

Diagram Explanation πŸ“ˆ

Nodes: Represent each subset in 𝑃(𝑆)P(S) Edges: Represent subset relations, connecting smaller sets to larger ones by inclusion.

Usage πŸš€

Run the script:

python hasse_diagram.py

View the output:
The program will display a Hasse diagram for P(S) with all subset inclusion relations.

Installation and Setup 🧰

Clone this repository:

git clone https://github.com/yourusername/Hasse-Diagram-PowerSet.git
cd Hasse-Diagram-PowerSet

Install required packages:

pip install networkx matplotlib

Example πŸ“ˆ

Screenshot 2024-10-25 224740

Code Explanation πŸ“

Define the power set and subset relations: The script defines the power set of S={a,b,c} and uses directed edges to represent subset inclusions. Visualize with matplotlib: Using NetworkX’s shell_layout for a structured, hierarchical view of subset relations.

Built With πŸ› οΈ

  • Python 🐍
  • NetworkX πŸ“ˆ
  • Matplotlib πŸ“Š

Thanks
-Shivansh :)

About

Generate a Hasse diagram for the power set P(𝑆) of a given set 𝑆={π‘Ž,𝑏,𝑐} using NetworkX in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages