Message Boards Message Boards

5 Replies
0 Total Likes
View groups...
Share this post:

Is it possible to implement this algorithm in Mathematica?

Posted 10 years ago

After having tried to make the translation of this article was in Spanish, I am writing to share it and to ask them if it is possible to implement it in Mathematica, ask this because my teacher says that the knows how only with object-oriented programming, I'm moving in construction after I will share grasp what I am doing. Greetings to all and any feedback is welcome.

Here is the article, I hope this is understandable.

POSTED BY: Luis Ledesma
5 Replies

I think one key to implementing GRASP or any other heuristic optimization for this problem is to decide how to encode the rectangle placement.

One possibility is to simply give an ordered list of rectangles and make the "placement function" put each new one either to the right side of the prior, or, if it won't fit there, to the left and above all priors on the same sheet, or, if it won't fit there, in the lower left corner of a new sheet. This is not terribly efficient use of space but it makes for a reasonably fast decoding. The objective function could then use this placement to determine wastage.

For actual optimization a particle swarm method (PSO), differential evolution (DE) or other evolutionary algorithm (EA) approach, GRASP, or other methods might be employed. If PSO or an EA is used then there is also the issue of how to create new orderings from old ones (in effect, how to create a new permutation from existing permutations). Suffice it to say that there are various ways one might go about this.

The following might be useful both for formulating an encoding and for solver possibilities.

R. Chiong and O. Koon Bend. A Comparison between genetic algorithms and evolutionary programming based on cutting stock problem. Engineering Letters 14:1, 2007.

J. Puchinger, G. Raidl, G. Koller. Solving a real-world cutting problem. Evolutionary Computation in Combinatorial Optimization Lecture Notes in Computer Science Volume 3004, 2004, pp 165-176.

C. Oliviera, P. Pardalos, M. Resende. GRASP with path-relinking for the quadratic assignment problem. LCNS 3059, 2004. Earlier version (2003) in MIC2003: The Fifth Metaheuristics International Conference.

POSTED BY: Daniel Lichtblau

Whether you're doing object oriented programming or not, the questions you need to ask are "what are my data types?" and "what functions apply to them?". For complicated problems, using a functional programming approach can be good, especially at the start. You break the problem done into small pieces and write functions for each of those small pieces. That makes it easier to debug. Also, rule based programming methods can be used to make simple functions that manipulate the data.

POSTED BY: Frank Kampas
Posted 10 years ago

Hi David, you have fully understood the idea of my question, I would comment that I'm trying not to use object oriented programming to solve this problem,but I'm having some problems

POSTED BY: Luis Ledesma

I think the original poster is asking if the algorithm described in the attached PDF can be implemented in Mathematica rather than if it can be done in an object oriented programming paradigm (I think he is saying that his advisor is only familiar with OO programming).

Either way, the answer will very likely be "yes". However the PDF is long and detailed and it is probably not likely that someone here will program it for the original poster unless they are already familiar with it. I'd recommend to the original poster to just dive in and start a project of implementing this in Mathematica, learning as he works through it. If he does not feel that he knows enough Mathematica yet to tackle this then reading a book like Paul Wellin's

wold get him started with learning enough to tackle this.

POSTED BY: David Reiss

It's possible to do object oriented programming in Mathematica, as shown by Roman Maeder, quite some time ago.

There is also an add-on package called Objectica which does object oriented programming in a more efficient manner than Roman Maeder's approach, which was mainly designed to illustrated the principles.

However, Mathematica supports procedural, functional and rule-based programming, which is sufficient for any problem.

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract