Coder Social home page Coder Social logo

projet-go's Introduction

GO server-client Dijkstra

This is a Go (Golang) program that implements a TCP server. The server listens for incoming connections on port 8081 and creates a go routine for each client to handle the communication. The program receives a matrix of integers from the client, and for each pair of nodes in the graph represented by the matrix, it calculates the shortest path between them using Dijkstra's algorithm and sends the result back to the client. The result includes the start and end nodes, the distance between them, and the previous node in the shortest path.

Requirements

  • GO for windows or linux (tested on go version go1.19.4 windows/amd64 and go version go1.15.9 linux/amd64)

Running the Application

To run the application, install Golang, clone this repository or download the files in the same repository on your computer, and use the following commands in two different terminals open in the same repository (where the files of this application are saved):

go run server_dijkstra.go go run client_dijkstra.go

Functionality

  • Multiple clients can ask simultaneously to calculate the Dijkstra on different matrix (one at a time per client)

The client opens a matrice file, reads its contents, and sends it to the server. The server converts the received string into a 2D integer array, performs Dijkstra's shortest path algorithm on it, and sends the results back to the client. The client displays the results.

The program uses the bufio, fmt, io, net, strconv, and strings packages.

projet-go's People

Contributors

julie-mg avatar ran190 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.