Skip to content

Noor-Afsha7/social-network-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ 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

  1. Build a graph from user connections
  2. Perform BFS from the target user
  3. Track levels (distance from source)
  4. Extract users at level 2
  5. Filter direct friends
  6. 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 πŸš€

About

Social network friend recommendation system using BFS in C.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages