D:\java\MinShip\my-minship-app>mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-minship-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ my-minship-app ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\java\MinShip\my-minship-app\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ my-minship-app ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to D:\java\MinShip\my-minship-app\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ my-minship-app ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\java\MinShip\my-minship-app\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ my-minship-app ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ my-minship-app ---
[INFO] Surefire report directory: D:\java\MinShip\my-minship-app\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.smkltd.app.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ my-minship-app ---
[INFO] Building jar: D:\java\MinShip\my-minship-app\target\my-minship-app-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.141 s
[INFO] Finished at: 2015-01-10T01:51:26-05:00
[INFO] Final Memory: 13M/489M
[INFO] ------------------------------------------------------------------------
D:\java\MinShip\my-minship-app>java -cp target/my-minship-app-1.0-SNAPSHOT.jar com.smkltd.app.Transaction
Money transfer from vertex[row] to vertex[col].
A negative amount would be a transfer in the opposite direction.
R[col] is the amount total received by a vertex, S[row] is the total amount sent
by a vertex, and the net amount for each vertex is C[col] = R[col] - S[col]
v0 v1 v2 v3 v4 v5 v6 S
v0 49.48 64.28 32.47 71.39 73.78 50.24 32.67 374.33
v1 11.83 18.96 90.73 24.69 12.88 25.33 35.02 219.44
v2 73.01 54.76 62.48 16.49 54.50 68.91 12.49 342.63
v3 62.26 2.98 71.65 28.37 68.56 61.44 2.68 297.94
v4 1.02 39.46 33.07 43.70 92.85 52.25 34.27 296.62
v5 40.45 50.08 39.19 54.92 21.71 15.29 54.08 275.73
v6 90.17 42.28 64.34 57.21 96.94 27.09 26.08 404.11
R 328.22 272.79 393.94 296.78 421.23 300.56 197.29
C -46.11 53.35 51.30 -1.16 124.61 24.83 -206.83
This is the projection of the above example into the cocycle space of the graph.
v0 v1 v2 v3 v4 v5 v6 S
v0 0.00 7.10 6.96 3.21 12.19 5.07 -11.48 23.05
v1 -7.10 0.00 -0.15 -3.89 5.09 -2.04 -18.58 -26.68
v2 -6.96 0.15 0.00 -3.75 5.24 -1.89 -18.44 -25.65
v3 -3.21 3.89 3.75 0.00 8.98 1.86 -14.69 0.58
v4 -12.19 -5.09 -5.24 -8.98 0.00 -7.13 -23.67 -62.31
v5 -5.07 2.04 1.89 -1.86 7.13 0.00 -16.55 -12.42
v6 11.48 18.58 18.44 14.69 23.67 16.55 0.00 103.41
R -23.05 26.68 25.65 -0.58 62.31 12.42 -103.41
C -46.11 53.35 51.30 -1.16 124.61 24.83 -206.83
This is the equivalent of the above matrix in terms of non-negative amounts.
We have taken the cocycle matrix minus its transpose and zeroed out the negatives.
v0 v1 v2 v3 v4 v5 v6 S
v0 0.00 14.21 13.92 6.42 24.39 10.13 0.00 69.07
v1 0.00 0.00 0.00 0.00 10.18 0.00 0.00 10.18
v2 0.00 0.29 0.00 0.00 10.47 0.00 0.00 10.77
v3 0.00 7.79 7.49 0.00 17.97 3.71 0.00 36.96
v4 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
v5 0.00 4.07 3.78 0.00 14.25 0.00 0.00 22.11
v6 22.96 37.17 36.88 29.38 47.35 33.09 0.00 206.83
R 22.96 63.53 62.07 35.80 124.61 46.94 0.00
C -46.11 53.35 51.30 -1.16 124.61 24.83 -206.83
A random example.
v0 v1 v2 v3 v4 v5 v6 S
v0 75.96 932.96 4.72 58.91 178.97 43.28 205.05 1,499.86
v1 326.06 370.68 4.03 7.58 616.45 60.88 18.79 1,404.48
v2 872.18 107.72 248.97 0.72 265.14 129.62 16.35 1,640.71
v3 272.57 246.62 1.67 234.71 5.24 78.98 993.47 1,833.26
v4 4.69 652.42 249.96 130.84 247.80 181.38 76.70 1,543.80
v5 78.76 605.33 157.54 0.26 17.82 328.69 25.04 1,213.45
v6 102.25 0.85 0.17 101.69 8.48 8.96 230.40 452.79
R 1,732.48 2,916.58 667.08 534.72 1,339.91 831.78 1,565.80
C 232.62 1,512.10 -973.63 -1,298.54 -203.89 -381.66 1,113.01
The cocycle projection.
v0 v1 v2 v3 v4 v5 v6 S
v0 0.00 91.39 -86.16 -109.37 -31.18 -43.88 62.89 -116.31
v1 -91.39 0.00 -177.55 -200.76 -122.57 -135.27 -28.51 -756.05
v2 86.16 177.55 0.00 -23.21 54.98 42.28 149.05 486.81
v3 109.37 200.76 23.21 0.00 78.19 65.49 172.25 649.27
v4 31.18 122.57 -54.98 -78.19 0.00 -12.70 94.06 101.94
v5 43.88 135.27 -42.28 -65.49 12.70 0.00 106.76 190.83
v6 -62.89 28.51 -149.05 -172.25 -94.06 -106.76 0.00 -556.50
R 116.31 756.05 -486.81 -649.27 -101.94 -190.83 556.50
C 232.62 1,512.10 -973.63 -1,298.54 -203.89 -381.66 1,113.01
The effective transfers.
v0 v1 v2 v3 v4 v5 v6 S
v0 0.00 182.78 0.00 0.00 0.00 0.00 125.77 308.55
v1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
v2 172.32 355.10 0.00 0.00 109.96 84.57 298.09 1,020.05
v3 218.74 401.52 46.42 0.00 156.38 130.98 344.51 1,298.54
v4 62.36 245.14 0.00 0.00 0.00 0.00 188.13 495.63
v5 87.75 270.54 0.00 0.00 25.40 0.00 213.52 597.21
v6 0.00 57.01 0.00 0.00 0.00 0.00 0.00 57.01
R 541.17 1,512.10 46.42 0.00 291.74 215.55 1,170.02
C 232.62 1,512.10 -973.63 -1,298.54 -203.89 -381.66 1,113.01