Update Floyd-Warshall with some generality
*check*
update KMP
*check*