Optimization from Excel to R

r
excel
optimization

#1

I am struggling with solving below optimization in R. It was easy for me to do with excel solver but I am not able to do same problem in R. I don’t have much experience in optimization in R Problem is to assign when a particular activity should be a done over the time period. A1, A2,…, A12 are 12 activities which are done in a field. 0 stands for not assigned, 1 stands for assigned.

Constraints are -

  1. A2 should happen after A1 is completed, A3 should occur after A2 is complete and so on
  2. A3, A5, A6 - only two of these activities can happen on a particular day
  3. Each activity should happen in a field (in excel solver, this constraint is defined by taking row sum equals to one)
    It would be a great help, if anyone can help in solving this problem. I have attached image for better understanding of this problem. Also, please let me know if there is any site or book, rich in examples on “how to solve optimization problems in R”.