gen_path_mat function

Generate path matrix from data file