https://github.com/phaniteja5789/graph_pandas
Implementation of Graph which contain cycle and its Traversal from Pandas DataFrame
https://github.com/phaniteja5789/graph_pandas
datastructures-algorithms python3
Last synced: 7 months ago
JSON representation
Implementation of Graph which contain cycle and its Traversal from Pandas DataFrame
- Host: GitHub
- URL: https://github.com/phaniteja5789/graph_pandas
- Owner: phaniteja5789
- Created: 2023-05-28T07:06:52.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-28T17:26:11.000Z (over 2 years ago)
- Last Synced: 2025-02-17T00:44:23.781Z (10 months ago)
- Topics: datastructures-algorithms, python3
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Graph_Pandas
Implementation of Graph from Pandas DataFrame
**Requirement :**
Get the Traversal Path to reach any Node that is present in the data frame.
**Input**
The below is the dataframe

**Implementation Approach**
1.) Based on the data frame given, sorted the dataframe based on the Level Column in the dataframe
2.) From Level-0, Implemented a BFS Traversal with using Queue DataStructure and construct the graph
3.) From the input node, with the help of Parents column, traverse the path from given node till root node
**Installed Modules**
1.) Pandas
2.) Numpy
3.) re
4.) random
**Data Structures Used**
1.) List
2.) Queue using List
3.) Set
**Sample Input & Output**
Input - N2
give the traversal to reach N2 Node
Output -
Similarly based on the data frame, we can build the N-Ary Graph with n number of children and n number of parents.