-
Notifications
You must be signed in to change notification settings - Fork 8
Pipelines
Pipelines describe sequence of actions that you want to automate such as reading from file, writing to file, coarsening, characteristics evaluation and so on.
In order to run pipeline, you need to create file in .yaml format. This sequence should obey some rules.
First of all, you need to specify the name of pipeline followed by colon:
my_pipeline:
Note: you can define multiple pipelines in one file.
After that you can write combination of supported functions (cf. Functions section). Each function should be written after two spaces and dash. Parameters of the function should not have dash.
my_pipeline:
- graph_generate: washington_test
- graph_output: graph.bin
Pipelines functions become available when you include modules/pch/precomp.h
file.
Class 'PipelineParser' provides pipelines interface. First of all you need to construct PipelineParser object. In order to do that you need to send file name as const std::string &
.
PipelineParser pipeline("file.yaml");
After that you should launch this by calling this function.
pipeline.launch();
-
input
input: file_name
Reads CSR graph from binary file 'file_name'
-
graph_generate
graph_generate: generator_name n: number m: number
Generates graph of the following type.
n
,m
are specific to each generator values (not always required) -
coarsening
coarsening: coarsening_type
Does graph coarsening. Types of coarsening:
- matching:
random, hard, edmonds
Count (optional): how many times you want to perform coarsening, default = 1.
Example:coarsening: matching type: random count: 10
- matching:
-
evaluate
evaluate: characteristic
Evaluates the following characteristic for the table described in
scripts/pipelines_table.py
Warning: All functions in pipeline are processing one by one, so this function will evaluate characteristic when it is called.
List of characteristics:-
pipeline_time
- time (starting from PipelineParser constructor call) -
vertexes
- number of vertexes in graph -
edges
- number of edges in graph -
avg_vertex_degree
- average degree of vertexes -
max_vertex_weight
- maximal vertex weight -
graph_diameter
- graph diameter -
graph_radius
- graph radius -
vertexes_in_scc
- average number of vertexes in strongly connected components -
bridges
- number of bridges in graph -
joint_points
- number of joint points in graph -
avg_eccentricity
- average vertexes eccentricity -
cost_mst
- sum of edges cost in minimal spanning tree
-
-
graph_output
graph_output: file_name
Writes CSR graph to binary file 'file_name'
-
table_output
table_output: file_name
Attributes:
- append: 0 - false, 1 - true. If you want to append new result without erasing previous ones, you should choose 1, 0 overwise.
Creates table with configuration described in
scripts/pipelines_table.py
Note: Before export itself you need to calculate characteristics (cf. evaluate function) -
convert
convert: convert_type
Performs graph conversion.
List of conversions:-
undirected
- converts this graph to undirected one -
unweighted
- converts this graph to unweighted one
-
-
graph_export_edges
graph_export_edges: file_name
Exports info about graph edges in the following format:
<edge1_begin> <edge1_end> <edge1_weight> <edge2_begin> <edge2_end> <edge2_weight> ... <edgen_begin> <edgen_end> <edgen_weight>
This option may be useful for, for example, graph visualization.
sample_pipeline:
- graph_generate: cube_test
n: 25
weighted: 1
- graph_export_edges: ../graph_data/cube_01.txt
- coarsening: matching
type: random
count: 5
- coarsening: matching
type: hard
count: 5
- evaluate: pipeline_time
- evaluate: vertexes
- evaluate: edges
- graph_output: ../graph_data/cube_test_compressed.bin
- table_output: ../graph_data/table.txt
append: 0
- graph_export_edges: ../graph_data/cube_02.txt