Jump to content

Archived

This topic is now archived and is closed to further replies.

ZMM

Graphical Bin Packing using PHP?

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!

Share this post


Link to post
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.

Share this post


Link to post
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.

 

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×
×
  • 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.