1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Fortran Project

  1. Oct 22, 2009 #1
    1. The problem statement, all variables and given/known data

    Hi, I have to do a project in Fortran based on solving a system. My professor mentioned one idea to me, I am trying to see if this idea is even feasible and some potential ways to progress through it before I submit a project proposal to do it.

    The problem is based on the square packing problem.

    So for example a user inputs the coordinates of a large rectangle. The program then generates 100 squares all of varying sizes, and maximizes the amount of surface area the rectangle can be covered with those random squares generated. The squares cannot overlap or go outside the boundaries. Also, for extra credit possibly to show this as a GUI.

    2. Relevant equations
    This is an introductory course, so I may not have learned all the tools to fortran I need yet. But can anyone give me an idea as to the degree of programming difficulty. I know most of the basics, like subroutines, functions, loops, conditionals, variables, input, output.

    3. The attempt at a solution
    I am pretty stumped as to an algorithm to solve this as well. So far I can only think of doing the following pseudo-code:

    1.User inputs 3-5 coordinates (putting a maximum at a 5 sided shape)

    2.Program randomizes a variable amount of squares of random sizes within a range (the amount of squares generated can be determined by user, that way to increase the amount of surface area covered you just generate more squares sort of like an approximation method for the surface area)

    3.Potentially represent the squares generated as coordinates as well in array format?

    From 3 on, I am stumped: Any feedback would be much appreciated. Thank you.
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted