A Python-based social network analysis tool that models friendships, analyses network relationships, and recommends new connections based on mutual friends.
Built as part of a university data structures and algorithms module.
- Load & Display Networks — reads social network data from text files and displays friendship connections
- Friend Recommendations — suggests new friends based on mutual connection count
- Network Analytics — categorises members by friend group size (singletons, pairs, triangles, etc.)
- Indirect Relationships — identifies friend-of-friend connections across the network
- Least Connected Members — finds members with the fewest connections
The system reads a social network from a .txt file where each line represents a member and their connections. It then applies graph-based logic to:
- Validate bidirectional friendship consistency
- Calculate mutual friends between all user pairs
- Recommend the most suitable new connection for a given member
python main.pyFollow the prompts to load a network file and explore recommendations.
├── main.py # Entry point — runs all features sequentially
├── openingfile.py # File loader and network display
├── feature_2.py # Friend recommendation engine
├── feature_3.py # Indirect relationship analyser
├── feature1.py # Social network manager
├── feature2.py # Network statistics and analytics
└── feature3.py # Core database and validation logic
- Python 3
- Standard library only (no external dependencies)
Muhammad Basil Faisal — LinkedIn