Graphite formation by the dissolution—precipitation of carbon in cobalt, nickel and iron