π Friend Recommendation System (C + BFS)
π Overview
This project implements a Friend Recommendation System using Graph Data Structure and Breadth-First Search (BFS) in C.
Users are represented as nodes and friendships as edges. The system suggests new connections based on friends-of-friends (level 2 connections) β similar to real-world social platforms.
β¨ Features
-
π Graph representation using Adjacency List (Linked List)
-
π Efficient BFS Traversal
-
π₯ Recommends friends of friends
-
π« Filters out:
- The user themselves
- Existing direct friends
π§ Concepts Used
- Graph Data Structure
- Breadth-First Search (BFS)
- Queue (Array Implementation)
- Linked List
βοΈ How It Works
- Build a graph from user connections
- Perform BFS from the target user
- Track levels (distance from source)
- Extract users at level 2
- Filter direct friends
- Display recommendations
π₯οΈ Example
πΉ Input
Enter the number of users: 5
Enter the number of connections: 4
Connections:
0 1
0 2
1 3
2 4
Enter user: 0
πΉ Output
Friend Recommendations for user 0:
User 3
User 4
π Project Structure
.
βββ socialnetworkproject.c
βββ README.md
π οΈ How to Run
gcc socialnetworkproject.c -o program
./programπ Limitations
- β No ranking of recommendations
- β No personalization (interests/activity not considered)
- β Fixed size (
Max = 100)
π Future Improvements
- β Rank users based on mutual friends
- π Add scoring system for better recommendations
- π Use dynamic memory allocation
- π€ Integrate AI/ML-based recommendation logic
π Conclusion
This project demonstrates how graph algorithms like BFS can be applied to real-world problems such as social network recommendations.
π©βπ» Author
Noor B.Tech Computer Engineering Student π