2d array gen and init in apsp tweak