how to reindex a sparse associative array
问题 first off, this question is not related to a specific language - I use Haxe to target multiple platforms - so a pseudo code will be more than enough. here's my problem : I have a sparse Matrix description in this form: edges = [ 1,1,2,1,3,1,4,1, 2,2,3,2, 3,3,4,3,5,3, 4,4,5,4,6,4, 5,5,6,5,7,5,25,5,27,5,28,5,29,5,30,5 ]; this describes edges associations: point 1 is linked to points 1, 2, 3 & 4 point 2 is linked to points 2 & 3 point 3 is linked to points 3, 4 & 5 point 4 is linked to points 4,