Description
The goal of this assignment is to generalize your solution to lab 7. We restrict ourselves to graphs on 5 vertices, labeled x1, x2, x3, x4, x5. We form a directed graph
on x1, x2, x3, x4, x5 by having all possible edges xixj .
Make an .m file that takes as an input a 5 length vector V and an upper triangular
1, 0, −1 valued 5×5 matrix B.
• The ith entry of V is the flow into vertex xi (if negative, then the flow is
out of xi).
• In B, For i < j the ij entry will be 1 if the flow is from xi to xj , 0 if there
is no flow from xi to xj , and −1 if the flow is from xj to xi
; 0 otherwise.
.
For the following four inputs draw out the labeled digraph (no submission, just
for your visualization). Then, make an augmented matrix C with the ith row
corresponding to the flow through vertex i. Then,
• If C is inconsistent, output saying that no such solution exists.
• If C is consistent, calculate Xp and XS (you may want to count the number
of all 0 rows).
.
Examples to try:
(1) V = [1,2,-3,4,-5], B = [0,1,1,1,1; 0,0,1,1,1; 0,0,0,1,1; 0,0,0,0,1; 0,0,0,0,0]
(2) V = [50,-35,-25,40, -30], B = [0,-1,0,0,1; 0,0,-1,0,0; 0,0,0,-1,0; 0,0,0,0,-1;
0,0,0,0,0]
(3) V = [50,50,-60,-40, 0], B = [0,1,0,1,1; 0,0,1,0,1; 0,0,0,-1,-1; 0,0,0,0,-1; 0,0,0,0,0]
.
Submit a .m file and a diary .txt file showing the workings of your code.


