I have a text file ‘G.txt’ that has the looks like this:
Prepare a python program which accepts a file name and produces an adjacency matrix based on the data in that file. Make sure that you can identify vertices by their name (which need not be one character) and be sure to close the file when you are done with it.
Then, add to your existing python file a program which accepts a file name and a table representing an adjacency matrix which writes the adjacency matrix to that file.
**You are not allowed to import any Python library or module and should not be using any inbuilt python functions that simplify the tasks you are told to implement.
Show transcribed image texta:c:g:w:Q 0 12 1 9 1 00 6 0 20 0 15 2 1 6 15 0 7 9 0 27 0