-
Notifications
You must be signed in to change notification settings - Fork 0
Graph reading strategy
Inno Fang edited this page Jun 3, 2019
·
4 revisions
This project include 4 graph reading strategy:
- EmailEuCoreDataSet : read and load email-Eu-core data set.
- GraphDBDataSet : read and load GraphDB data set
- UnweightedDiGraphDataSet : read and load Unweighted Digraph data set
- UnweightedGraphDBDataSet : read and load unweighted GraphDB data set
Of course you an customize the graph reading strategy, strategy can be implemented according to the format of data set. This can be accomplished by implementing the load method of DataSetStrategy.
public class CustomDataSet implements DataSetStrategy {
@Override
public List<Graph> load(String filePath) throws IOException {
// ...
}
}
And the usage of strategy are as follow:
// specify the graph reading strategy
GraphReader reader = new GraphReader();
try {
List<Graph> sourceGraphs = graphReader.read(sourceGraphFilePath);
List<Graph> targetGraphs = graphReader.read(targetGraphFilePath);
// the following code ...
} catch (IOException e) {
e.printStackTrace();
}