-
Notifications
You must be signed in to change notification settings - Fork 6
A simple library for generating random directed acyclic graphs represented by adjacency matrices
retrohacker/dagGen
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Javadoc can be found here: http://wblankenship.github.io/dagGen/javadoc/ Below are some code snippets showing how to use the library /* * Generate a random matrix and print it */ DAGSmith smith = new DAGSmith(); boolean[][] dag = smith.generateRandomDAG(10, 2); System.out.println(DAGTools.printDAG(dag)); System.out.println("Generated a " + dag.length + "x" + dag[0].length + " DAG with " + DAGTools.getEdges(dag) + " edges."); /* * Save file to disk */ DAGTools.saveToFile(dag, "1.dag"); /* * Read file from disk */ DAGParse parse = new DAGParse(); try { dag = parse.parseDependancies("1.dag"); System.out.println(DAGTools.printDAG(dag)); System.out.println("Read a " + dag.length + "x" + dag[0].length + " DAG with " + DAGTools.getEdges(dag) + " edges."); } catch (Exception e) { System.out.println("Failed getting file!"); e.printStackTrace(); }
About
A simple library for generating random directed acyclic graphs represented by adjacency matrices
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published