cadevue

カデュエ

Github Repository:
https://github.com/cadevue/closest-pair-solver

Try Now!

This application can be tried out immediately! The web application can be accessed in this link:
https://closest-pair-frontend.pages.dev/

Project Description

A web application that solve the closest pair problem using 2 kind of algorithm — Brute Force and Divide and Conquer. The application shows the comparison between the two algorithms in terms of execution time and number of Euclidean operations needed to solve the problem.

The frontend is built using Typescript and Three.js, while the backend is built using Golang. The program is deployed using Cloudflare Pages (frontend) and Docker-AWS EC2 (backend). The communication between the frontend and backend is done using websocket.

Here is the specification of the request and response for the websocket communication:

type SolveCPRequest struct {
	Method    string    `json:"method"`
	Dimension int32     `json:"dimension"`
	Points    []float64 `json:"points"`
}

type SolveCPResponse struct {
	Method            string   `json:"method"`
	Indexes           [2]int32 `json:"indexes"`
	Distance          float64  `json:"distance"`
	NumOfEuclideanOps int64    `json:"numOfEuclideanOps"`
	ExecutionTime     float64  `json:"executionTime"`
}

Frontend

https://github.com/cadevue/closest-pair-frontend/tree/master

The technologies used for the frontend are:

  • Typescript as the language
  • Three.js for the 3D rendering of the points
  • Vite for frontend bundling
  • TailwindCSS for styling
  • JS Websocket for the communication with the backend
  • Cloudflare Pages for the deployment

Backend

https://github.com/cadevue/closest-pair-backend/tree/master

The technologies used for the backend are:

  • Golang as the language
  • Docker for containerization
  • AWS EC2 for the deployment
  • Gorillaz Websocket for communication with the frontend
  • Github Actions for the CI/CD pipeline

Deployment

The web application can be accessed in this link:
https://closest-pair-frontend.pages.dev/

Screenshots

Here are some screenshots of the closest pair solver web application.

Application Idle

Closest Pair Solver Screenshot - Application Idle

Solving the Closest Pair

Closest Pair Solver Screenshot - Solving the Closest Pair

Result Visualization and Logs

Closest Pair Solver Screenshot - Result Visualization and Logs

Connection Close when Idle

Closest Pair Solver Screenshot - Connection Close when Idle