Jump to content

Recommended Posts

Hi,

 

For a project I need to create a visual/graphical bin-packing algorithm program and I was planning to use Java with JavaFX to make it a normal GUI computer app - however, as I don't like Java that much and I have way more experience in PHP and jQuery, I was wondering if you guys think it would be possible to make this project as a website using PHP and jQuery because I haven't worked with PHP for a long time and I'm not sure if the appropriate tools are available to make something like this.

 

Basically this is what I want to do:

  • Ask user how many bins he wants and with what sizes + a set of numbers they would like to use to fill the bins with
  • Draw/show the bins on one side of the page and the numbers on the other side
  • Have the ability to drag numbers into any bin
  • Once the bin is full, it gets filled with a red background
  • The ability to write the bin-packing algorithm itself in PHP and have a button that can do it all for the user automatically

Do you think something similar to this would be possible at all as a website or would I be better off using JavaFX to create an application? Please note that this is just a whole concept I had in mind, so I wasn't assuming what's actually doable and what's not within the time frame I got (until the first week of May).

 

I would really appreciate any thoughts on this

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/285238-graphical-bin-packing-using-php/
Share on other sites

Based on what you wrote for requirements, the entire thing could be done with just Javascript without any need for PHP at all. If you want to use PHP that is fine, but it is unnecessary unless you want to do some kind of DB interaction like save/load stuff.

 

For the UI you would just design your web page however you want things to display, then add the interactive stuff like drag-n-drop using Javascript. jQuery will make the javascript part considerably easier to implement and help keep things organized better.

Based on what you wrote for requirements, the entire thing could be done with just Javascript without any need for PHP at all. If you want to use PHP that is fine, but it is unnecessary unless you want to do some kind of DB interaction like save/load stuff.

 

For the UI you would just design your web page however you want things to display, then add the interactive stuff like drag-n-drop using Javascript. jQuery will make the javascript part considerably easier to implement and help keep things organized better.

 

First of all thank you for your reply, it is much appreciated!

Just a question came to my mind: wouldn't I need to write the bin-packing algorithm itself in PHP?

  • Solution

No, you could write it in Javascript. You'd only need to implement it in PHP if you wanted to keep people from viewing your implementation details. In this particular problem there is nothing that PHP can do which Javascript cannot.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.