diff --git a/VRE_VQE_QAOA.ipynb b/VRE_VQE_QAOA.ipynb index 681deb891d6d48d598f601e931324a8a9aabd1a1..bc043797efe88230f6b39a5749fc197e7231f73e 100644 --- a/VRE_VQE_QAOA.ipynb +++ b/VRE_VQE_QAOA.ipynb @@ -75,29 +75,30 @@ "$$\n", "H_{\\text{VRP}} = \\sum_{k} \\sum_{i} \\sum_{j} d_{i,j} \\cdot x_{i,j,k}\n", "$$\n", - "\n", - "### **Constraints**\n", - "1ï¸âƒ£ **Each location is visited exactly once (except the depot):**\n", - "$$\n", - "\\sum_{k} \\sum_{j} x_{i,j,k} = 1, \\quad \\forall i \\neq 0\n", - "$$\n", - "\n", - "2ï¸âƒ£ **Each vehicle starts and ends at the depot:**\n", - "$$\n", - "\\sum_{j} x_{0,j,k} = 1, \\quad \\forall k, \\quad \\sum_{i} x_{i,0,k} = 1, \\quad \\forall k\n", - "$$\n", - "\n", - "3ï¸âƒ£ **Vehicle route continuity (no teleportation):**\n", - "$$\n", - "\\sum_{j} x_{i,j,k} - \\sum_{j} x_{j,i,k} = 0, \\quad \\forall i, k\n", - "$$\n", - "\n", - "4ï¸âƒ£ **(Optional) Vehicle capacity constraint:**\n", - "If each location \\( i \\) has a demand \\( q_i \\) and the vehicle has capacity \\( C_k \\), then:\n", - "$$\n", - "\\sum_{i} q_i \\sum_{j} x_{i,j,k} \\leq C_k, \\quad \\forall k\n", - "$$\n", - "This ensures that no vehicle exceeds its allowed load.\n", + "\n",### 📌 Constraints + +1ï¸âƒ£ **Each location is visited exactly once (except the depot):** +$$ +\sum_{k} \sum_{j} x_{i,j,k} = 1, \quad \forall i \neq 0 +$$ + +2ï¸âƒ£ **Each vehicle starts and ends at the depot:** +$$ +\sum_{j} x_{0,j,k} = 1, \quad \forall k, \quad \sum_{i} x_{i,0,k} = 1, \quad \forall k +$$ + +3ï¸âƒ£ **Vehicle route continuity (no teleportation):** +$$ +\sum_{j} x_{i,j,k} - \sum_{j} x_{j,i,k} = 0, \quad \forall i, k +$$ + +4ï¸âƒ£ **(Optional) Vehicle capacity constraint:** +If each location \( i \) has a demand \( q_i \) and the vehicle has capacity \( C_k \), then: +$$ +\sum_{i} q_i \sum_{j} x_{i,j,k} \leq C_k, \quad \forall k +$$ +This ensures that no vehicle exceeds its allowed load. + "\n", "---\n", "\n",