Max-plus algebra critical circuit checker
[z] = maxplusisccir(x,A,l)
This function returns z = %T, if vector x is the critical circuit of G(A) and z = %F if the vector x is not the critical circuit of G(A).
A = [2. -%inf 8. 2. 9.; 6. -%inf -%inf 8. 8.; 8. -%inf 6. 1. 5.; 0. 2. 5. 3. 10.; 7. 4. -%inf -%inf 6.] [l,d,x] = maxplusccir(A) // critical circuits of matrix A // 3 -> 1 -> 3 // Check the vector x is a critical circuit of graph G(A) z = maxplusisccir(x,A,l) B= [12. -%inf -%inf 19. 13. 5. 15. -%inf -%inf -%inf; 11. 10. 16. 9. -%inf 13. 6. 8. 5. 18.; -%inf 8. -%inf -%inf 19. -%inf 8. -%inf 4. -%inf; 17. -%inf 16. -%inf -%inf 5. -%inf 17. 16. 19.; -%inf -%inf 4. -%inf 8. -%inf 20. -%inf 16. 14.; 6. 2. 7. -%inf -%inf -%inf -%inf -%inf 10. 19.; -%inf 1. -%inf -%inf 9. -%inf 14. 5. -%inf 1.; 19. -%inf 9. 19. 4. 20. 18. 10. 16. 11.; 5. -%inf 13. 15. -%inf -%inf -%inf 20. 3. -%inf; 18. 15. -%inf -%inf 7. -%inf 13. 9. 15. 6.]; [l,d,x] = maxplusccir(B) // critical circuits of matrix A // 1 -> 10 -> 4 -> 1 // Check the vector x is a critical circuit of graph G(B) z = maxplusisccir(x,B,l) e=-%inf; C=[e e 16 e e e e e e e; 14 15 18 e e e e e e e; 14 2 e 1 e e e e e e; 17 3 e 12 2 e 3 e e e; 12 e e 1 e e e e e e; e e e e e 8 e e e e; e e e e e e 7 19 e e; e e e e e e e e 2 e; e e e e e e e 13 e e; e e e e e 10 7 12 2 5]; [l,d,x] = maxplusccir(C) // critical circuits of matrix A // 6->6, 1 -> 3 -> 1, 8 -> 9 -> 8 // Check the vector x is a critical circuit of graph G(C) z = maxplusisccir(x,C,l) | ![]() | ![]() |