The DotGraphParser project provides functionality for parsing, modifying, and exporting DOT graphs. It allows you to:
- Parse DOT files to create an internal graph representation.
- Add nodes and edges to the graph, including handling duplicates.
- Export the graph as a DOT file or as an image (PNG).
-
Parsing a DOT File
- Ability to parse DOT files and load graph data.
-
Add Nodes
- Add new nodes to the graph.
- Ensure no duplicate nodes are created.
-
Add Edges
- Create new edges between nodes.
-
Export Graph
- Export the graph to a DOT file.
- Export the graph as a PNG image.
To use this project, you need Java and Maven installed.
Clone the repository:
git clone
Navigate to the project directory:
cd CSE-464-2024-amarwah3
Build the project using Maven:
mvn clean install
To Parse the DOT file use:
DotGraphParser parser = new DotGraphParser();
parser.parseGraph("sampleGraph.dot");
To add new Nodes and Edges to the graph:
parser.addNode("NewNode");
parser.addEdge("NodeA", "NodeB");
To Export the Graph: 1. To DOT:
parser.outputDOTGraph("outputGraph.dot");
2. To PNG:
parser.outputGraphics("outputGraph.png", "png");
To test the code run:
mvn test