Graph builders in order to persistent/imperative graphs sharing a same signature.
.
Note: the following functions always return graphs but this is meaningless for imperative implementations (the graph is modified in-place). This is just to provide a common interface.