improve sub-graph id handling.

Write the graph id in the csv files. Create the possibility of seting
the id to a desired value.