Convert ASCII representations of graphs into usable data structures in Python or C.
R /|\ A B C / | | D E F | \ G H --> Vertices = Vertex(id='R', rank=0) Vertex(id='A', rank=2) Vertex(id='B', rank=2) Vertex(id='C', rank=2) Vertex(id='D', rank=4) Vertex(id='E', rank=4) Vertex(id='F', rank=4) Vertex(id='G', rank=6) Vertex(id='H', rank=6) Adj = [0] [1, 0] [1, 0, 0] [1, 0, 0, 0] [0, 1, 0, 0, 0] [0, 0, 1, 0, 0, 0] [0, 0, 0, 1, 0, 0, 0] [0, 0, 0, 0, 1, 0, 0, 0] [0, 0, 0, 0, 0, 0, 1, 0, 0] R /|\ A B C / | | | D E F --> Stray edge segment '|' in graph at row 3, col 11. R /|\ A B C / | | < \ \ \ E F \ / \ / Long_Name --> Vertices = Vertex(id='R', rank=0) Vertex(id='A', rank=2) Vertex(id='B', rank=2) Vertex(id='C', rank=2) Vertex(id='E', rank=5) Vertex(id='F', rank=5) Vertex(id='Long_Name', rank=8) Adj = [0] [1, 0] [1, 0, 0] [1, 0, 0, 0] [0, 0, 1, 0, 0] [0, 0, 0, 1, 0, 0] [0, 1, 0, 0, 0, 1, 0] ^ / \ < > \ / B --> Vertices = Vertex(id='B', rank=5) Adj = [2] A / \ < > \ / B --> Vertices = Vertex(id='A', rank=1) Vertex(id='B', rank=5) Adj = [0] [2, 0]