Hi Mari,
A good start would be for you to upload a drawing or something to explain the problem. It would be helpful to upload a rhino or grasshopper file of what you have tried so far.
You are more likely to get some helpful advice if you read this first How to ask effective questions
This kind of optimization sounds quite doable