Traffic Flow Network
Math 294 Prof. Leise

AverageFlow={2047.6,2046.0,2002.6,2036.9,2013.5,2021.1,2027.4,2047.1,2020.9,2049.2,2015.1,2035.1,2033.3,2027.0,2034.9,2033.3,2008.9,2006.4,2050.0,2008.6,2001.6,2028.1}; (* given values for average traffic flow along each road segments *)

A=ConstantArray[0,{8,22}] (* create network matrix for the road system *)

A[[1,1]]=1;A[[1,6]]=1;A[[1,5]]=-1;A[[1,10]]=-1;
A[[2,2]]=1;A[[2,6]]=1;A[[2,7]]=-1;A[[2,11]]=-1;
A[[3,3]]=1;A[[3,8]]=1;A[[3,7]]=-1;A[[3,12]]=-1;
A[[4,4]]=1;A[[4,8]]=1;A[[4,9]]=-1;A[[4,13]]=-1;
A[[5,10]]=1;A[[5,14]]=1;A[[5,15]]=-1;A[[5,19]]=-1;
A[[6,11]]=1;A[[6,16]]=1;A[[6,15]]=-1;A[[6,20]]=-1;
A[[7,12]]=1;A[[7,16]]=1;A[[7,17]]=-1;A[[7,21]]=-1;
A[[8,13]]=1;A[[8,18]]=1;A[[8,17]]=-1;A[[8,22]]=-1;
A//MatrixForm