So, I have created a directed acyclic graph in c++, now I want to save it to a text file, or maybe files. How do I do that?
P.S: sorry for confusion… I mean to ask how to format the file.
Thanks in advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A simple way is to save first all nodes assigning to each of them a node ID, then save all arcs using the node ID of starting and ending node.
This will handle all cases (including non-connected graphs, multiply connected graphs, loops… etc.)