graph: from_file improvements