Search code examples
machine-learningneural-networkartificial-intelligence

Where to start for multi-variable optimization problem with ML?


I'm looking for a place to start for solving an optimization problem with ML.

Let's say I have a huge pile of bricks, and I need to pick out 50 bricks from this pile to arrange to make a wall. My bricks are all different types: some of my bricks are stronger than others and some are heavier, so each time I select a set of bricks, I need to do a (relatively slow) structural calculation to make sure the wall won't fall down. I have too many bricks in my pile in order to try every permutation by brute force, so I would like to use ML to help me find arrangements of bricks that are likely to work, because I have a few hundred previous sets that I know are ok.

There are also some subjective criteria that the wall needs to meet--maybe it looks ugly if I have too many green bricks. I have a good idea which criteria are looked at subjectively (e.g., I know the architect cares how many green bricks there are), but I would like to train an ML model with previous data to know what kind of weights to give these criteria, because I don't have any hard limit on how many green bricks are too many--I just have a dataset that shows that the architect didn't like some walls in the past that had a lot of green bricks.

Is this a problem that ML can help me solve? What frameworks/models should I investigate to solve this kind of problem? I'm having a hard time zeroing in on a place to start!


Solution

  • The answer depends a bit on whether you need help coming up with (generating) novel combinations, or whether you want to understand the variables that affect the likelihood of success/acceptance.

    If the later, you could approach this as a classification task. From your description you might come up with some features that describe the set of bricks you tested/will test such as: number of green bricks, total weight of bricks, average weight of bricks, weight of bottom row of bricks.

    You'd then have a table where each row would be a configuration of bricks and each column would be a feature generated above. You have and additional column for your target which would be true/false depending if the configuration was successful.

    +---------+------------+-------------+---------------+----------------+
    | n_green | weight_sum | weight_mean | weight_br_sum | target_success |
    +---------+------------+-------------+---------------+----------------+
    |      10 |        102 |         0.6 |            15 | true           |
    |       2 |         60 |         0.5 |            30 | false          |
    |      40 |        250 |         1.1 |            15 | true           |
    +---------+------------+-------------+---------------+----------------+
    

    You could use a linear model (e.g. Logistic Regression) with X the array of values from columns n_green:target_success and y being the target column. You can then look at the coefficients of the fitted model to understand what features have the largest effect on success (although you should scale your features first).

    You can then generate new combinations and run them through the fitted model to get a probability of success.

    If the arrangement/configuration of bricks is important you might want to investigate Neural networks and specifically Convolutional Neural Networks (CNN). You would have to use a library like ELI5 or Shap to investigate feature importance.

    If the former you should investigate GANs.