Git Product home page Git Product logo

parallel_bfs_server's Introduction

Parallel BFS - Network Programming Project @ FMI 2023

Table of Contents

  1. Introduction
  2. System Requirements
  3. Setup and Installation
  4. Client Server Communication
  5. Architecture
  6. Running the Application
  7. Testing

Introduction

This project implements a simple client-server system that performs a parallel Breadth-First Search (BFS) operation on a graph. The graph information is sent by the client to the server which performs the BFS operation in a parallelized manner using Python's multiprocessing capabilities.

System Requirements

  • Python 3.6 or higher
  • Networking permissions for the Python interpreter to open sockets

Setup and Installation

  1. Clone this repository or download the project zip.
  2. Extract the files to your desired location.
  3. Run the Python scripts as described in the "Running the Application" section.

Client Server Communication

The client prompts the user to enter a graph and sends this to the server. The server performs a parallel BFS on the received graph and returns the order of visited nodes back to the client.

Architecture

The application consists of two main Python scripts:

  • client.py: Sends the graph data as a JSON object to the server using a socket.

  • server.py: Receives the graph data, performs a parallel BFS using Python's multiprocessing module and returns the list of visited nodes back to the client.

Running the Application

Server

To run the server, ensure that server.py is in your current directory and run the following command in your terminal:

python3 server.py

Client

To run the client, ensure that client.py is in your current directory and run the following command in your terminal:

python3 client.py

When prompted, enter the graph information in the following format:

{'1': ['2', '3'], '2': ['4', '5'], '3': [], '4': [], '5': [], 'start': '1'}

Testing

Unit tests are included in the tests.py file.

To run the tests, navigate to the directory containing tests.py in your terminal/command prompt and use the command:

python3 -m unittest tests.py

License

This project is licensed under the MIT License - see the LICENSE.md file for details.


This project was created as part of the "Network Programming" course at the Faculty of Mathematics and Informatics (FMI), Sofia University, 2023.


Contact

For queries or assistance, please feel free to reach out.

parallel_bfs_server's People

Contributors

vaskonti avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.