The Polynomial Calculator is a Flask-based web application that evaluates polynomial expressions for a given value of ( x ). It leverages ZeroMQ for efficient communication between the server and worker nodes, dynamically allocating resources to handle complex computations.
- Web Interface: A user-friendly interface for entering polynomial terms and ( x ) values.
- Distributed Computation: Dynamically adjusts worker nodes to compute individual polynomial terms.
- Efficient Communication: Utilizes ZeroMQ for seamless client-server communication.
- Results Presentation: Displays the computation result and time taken on a clean, responsive results page.
- Enter Polynomial: Users provide the polynomial terms (e.g.,
3x^2 + 2x + 4
) and a value for ( x ). - Submit Request: The data is sent to the server via a Flask route.
- Distributed Processing: The server dynamically assigns polynomial terms to worker nodes for computation.
- Receive Results: The server aggregates results from the workers and calculates the final value, which is displayed to the user along with the computation time.
-
Frontend:
index.html
: Input form for polynomial terms and ( x ) value.result.html
: Displays the computed result and time.
-
Backend:
app.py
: Flask application handling the web interface and server-client communication.server.py
: Manages requests and delegates computations to workers.worker.py
: Computes polynomial terms individually.
-
Client:
client.py
: Simulates client-server interaction.
Client (Browser) --> Flask Server (app.py) --> Compute Server (server.py) --> Worker Nodes (worker.py)
- Python 3.8 or later
- Flask
- ZeroMQ
- Bootstrap (for frontend styling)
-
Clone the Repository:
git clone https://github.com/BunyaminYavuz/DistributedPolyEngine.git
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Server:
- Start the workers:
python worker.py
- Start the compute server:
python server.py
- Run the Flask app:
python app.py
- Start the workers:
-
Access the Application: Open http://127.0.0.1:5000 in your web browser.
- Input the polynomial terms in the format
coefficient x^exponent
(e.g.,3x^2+2x+4
). - Provide the value of ( x ).
- Submit to calculate the polynomial result.
- View the computed result and computation time.
Contributions are welcome! Please open an issue or submit a pull request for improvements.
This project is licensed under the MIT License. See the LICENSE file for details.
- Bootstrap for frontend styling.
- ZeroMQ for robust inter-process communication.