What Approach Should I Use? For This Problem

Process Flow Description

  1. Machine M1 receives raw material.
    M1 processes the material and sends it to M2.
  2. Machine M2 receives material from M1.
    M2 processes the material and sends it to M3.
  3. Machine M3 receives material from M2.
    M3 processes the material and sends it to M4.
  4. Machine M4 receives material from M3.
    M4 processes the material and sends it back to M2.
  5. Machine M2 receives material again from M4.
    M2 reprocesses the material and sends it to M3.
  6. Machine M3 receives the material again from M2.
    M3 reprocesses it and sends it to M4.
  7. Machine M4 receives the material again from M3.
    M4 processes it and finally sends it to M5.
  8. Machine M5 receives the final output from M4.

Overall Sequence in Order

M1 → M2 → M3 → M4 → M2 → M3 → M4 → M5
Additionally, M2 should not wait for material coming from M4; whenever M2 is free, it must immediately take material from M1 process and send to M3