This project implements a graph-based system for analyzing actor relationships in movies. The system processes input data to find connected components, calculate degrees of kinship between actors, and identify critical edges in the graph structure.
Development Time: 2 weeks and 2 days
- Connected Component Analysis: Identifies the largest connected component and stores it in a binary search tree
- Degree of Kinship: Calculates minimum distance between actors using Breadth-First Search (BFS)
- Critical Edge Detection: Implements Tarjan's algorithm to find critical connections
- Implemented basic data structures and file processing functions
- Used
fscanfwith loop iteration for input file parsing - Requirement 1 Completion:
- Found connected component with maximum nodes
- Stored component in a binary search tree
- Implemented in-order traversal for ascending order output
- Debugging Phase: Resolved multiple Valgrind errors in the Productions function (2-3 days)
- Requirement 2 Implementation: Added
Degreefunction for kinship calculation - Major Debugging Session:
- Addressed SIGSEGV errors using GDB
- Extensive Valgrind error resolution (2-3 days)
- BFS Implementation:
- Calculated the minimum distance between nodes
- Added validation functions for actor presence in the tree
- Memory Management: Implemented proper memory deallocation
- Requirement 3 Completion: Implemented in 2 days
- Tarjan's Algorithm Research and Implementation
- Complex Condition Checking:
- Implemented 14 validation conditions in
CriticalEdgesfunction - Added letter-based relationship verification between actor names
- Implemented 14 validation conditions in
actor->name: Actor's name (string)
actor->code: Unique identifier to prevent duplicates
- Binary search tree with left/right ordering
- Uses
Compare_Namesfunction for proper alphabetical ordering - Duplicate prevention built-in
- Object: Generic storage for node numbers or actor names
- Number_of_nodes: Total node count
- Adjency_List: Vector of adjacency lists for each node
- Next: Pointer for linked list traversal
- Actor_Compare: Function pointer for actor comparison
(char *)Graph->Adjency_List[1]->head->ObjectRetrieves the first actor's name in the graph.
- Used for calculating the degree of kinship
- Represents the minimum distance between any two actors
- Validates actor presence before calculation
- Implemented for critical edge detection
- Complex condition validation system (14 conditions)
- Analyzes character relationships in actor names
- Graph initialization and construction
- Binary tree management
- File I/O operations
- Memory management functions
Name_Movie: Movie name storageNames_Actors: Actor name collectionName_Actor1,Name_Actor2: Individual actor identifiers- Used for both tree/graph construction and memory cleanup
- In-order traversal for sorted actor output
- Newline separation for proper formatting
- Binary tree structure maintains alphabetical ordering
- Memory Management: Extensive Valgrind error resolution
- Segmentation Faults: Required GDB debugging sessions
- Algorithm Complexity: Tarjan's algorithm implementation
- Data Structure Integration: Binary tree and graph coordination
- No duplicate actors in final tree structure
- Proper memory deallocation at function completion
- Robust error handling throughout implementation
- Scalable design for large datasets
This project successfully demonstrates advanced graph algorithms, efficient data structure management, and complex debugging techniques. The implementation provides a solid foundation for actor relationship analysis in film databases.