why not start the second for-loop with j=i (or better yet i+1)?
... I mean, the first cycle connects point 1 with everything else. The second point thus only needs to be connected to all points after the first. (since 1->2 already exists). So in other words, since for the n-th point, the connections to all points lower than n already exist, you only need to connect it with all the others.
but then, its late. so i'm probably wrong.