Modified c code.

Fixed function signature. Added num_edge variable to let python quickly
create the resultant edge list.