Skip to content

basilfaisal75/Friend-Recommendation

Repository files navigation

Friend Recommendation System

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.

Features

  • 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

How It Works

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:

  1. Validate bidirectional friendship consistency
  2. Calculate mutual friends between all user pairs
  3. Recommend the most suitable new connection for a given member

Usage

python main.py

Follow the prompts to load a network file and explore recommendations.

Project Structure

├── 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

Tech Stack

  • Python 3
  • Standard library only (no external dependencies)

Author

Muhammad Basil Faisal — LinkedIn

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages