├── docs ├── .nojekyll ├── source │ ├── LICENSE.rst │ ├── _summaries │ │ ├── grape.utils.chunk_it.rst │ │ ├── grape.general_graph.GeneralGraph.area.rst │ │ ├── grape.general_graph.GeneralGraph.load.rst │ │ ├── grape.general_graph.GeneralGraph.mark.rst │ │ ├── grape.general_graph.GeneralGraph.type.rst │ │ ├── grape.general_graph.GeneralGraph.users.rst │ │ ├── grape.general_graph.GeneralGraph.weight.rst │ │ ├── grape.general_graph.GeneralGraph.service.rst │ │ ├── grape.general_graph.GeneralGraph.sources.rst │ │ ├── grape.general_graph.GeneralGraph.switches.rst │ │ ├── grape.general_graph.GeneralGraph.clear_data.rst │ │ ├── grape.general_graph.GeneralGraph.efficiency.rst │ │ ├── grape.general_graph.GeneralGraph.description.rst │ │ ├── grape.general_graph.GeneralGraph.init_status.rst │ │ ├── grape.general_graph.GeneralGraph.mark_status.rst │ │ ├── grape.general_graph.GeneralGraph.status_area.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.optimizer.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.rm_nodes.rst │ │ ├── grape.general_graph.GeneralGraph.final_status.rst │ │ ├── grape.general_graph.GeneralGraph.shortest_path.rst │ │ ├── grape.general_graph.GeneralGraph.compute_service.rst │ │ ├── grape.general_graph.GeneralGraph.father_condition.rst │ │ ├── grape.general_graph.GeneralGraph.initial_service.rst │ │ ├── grape.general_graph.GeneralGraph.local_efficiency.rst │ │ ├── grape.general_graph.GeneralGraph.nodal_efficiency.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.delete_a_node.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.update_output.rst │ │ ├── grape.general_graph.GeneralGraph.degree_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.efficiency_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.global_efficiency.rst │ │ ├── grape.general_graph.GeneralGraph.compute_efficiency.rst │ │ ├── grape.general_graph.GeneralGraph.indegree_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.closeness_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.construct_path_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.floyd_warshall_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.outdegree_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.shortest_path_length.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.apply_perturbation.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.fitness_evaluation.rst │ │ ├── grape.general_graph.GeneralGraph.betweenness_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.perturbation_resistant.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.update_status_areas.rst │ │ ├── grape.general_graph.GeneralGraph.calculate_shortest_path.rst │ │ ├── grape.general_graph.GeneralGraph.local_efficiency_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.nodal_efficiency_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.compute_local_efficiency.rst │ │ ├── grape.general_graph.GeneralGraph.compute_nodal_efficiency.rst │ │ ├── grape.general_graph.GeneralGraph.degree_centrality_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.compute_degree_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.indegree_centrality_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.shortest_path_list_kernel.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.check_input_with_gephi.rst │ │ ├── grape.general_graph.GeneralGraph.closeness_centrality_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.compute_indegree_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.outdegree_centrality_kernel.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.check_paths_and_measures.rst │ │ ├── grape.general_graph.GeneralGraph.compute_closeness_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.compute_outdegree_centrality.rst │ │ ├── grape.general_graph.GeneralGraph.betweenness_centrality_kernel.rst │ │ ├── grape.general_graph.GeneralGraph.floyd_warshall_initialization.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.fitness_evaluation_parallel.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.fitness_iteration_parallel.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.simulate_area_perturbation.rst │ │ ├── grape.general_graph.GeneralGraph.compute_betweenness_centrality.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.simulate_element_perturbation.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.graph_characterization_to_file.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.measure_iteration.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.measure_processes.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.compute_efficiency.rst │ │ ├── grape.general_graph.GeneralGraph.dijkstra_single_source_shortest_path.rst │ │ ├── grape.general_graph.GeneralGraph.floyd_warshall_predecessor_and_distance.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.calculate_shortest_path.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.compute_local_efficiency.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.compute_nodal_efficiency.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.compute_degree_centrality.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.compute_indegree_centrality.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.dijkstra_iteration_parallel.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.compute_closeness_centrality.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.compute_outdegree_centrality.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.shortest_path_list_iteration.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.compute_betweenness_centrality.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.dijkstra_single_source_shortest_path.rst │ │ ├── grape.parallel_general_graph.ParallelGeneralGraph.floyd_warshall_predecessor_and_distance.rst │ │ ├── grape.fault_diagnosis.FaultDiagnosis.rst │ │ ├── grape.general_graph.GeneralGraph.rst │ │ └── grape.parallel_general_graph.ParallelGeneralGraph.rst │ ├── contact.rst │ ├── code.rst │ ├── utils.rst │ ├── fault_diagnosis.rst │ ├── contributing.rst │ ├── parallel_general_graph.rst │ ├── general_code_output.log │ ├── general_graph.rst │ ├── index.rst │ └── conf.py ├── index.html ├── make_rst.sh └── Makefile ├── .checkignore ├── .gitattributes ├── tests ├── __init__.py ├── TOY_graph_one_node.csv ├── general_graph.py ├── TOY_graph.csv ├── test_input_graph.py ├── test_parallel_integer_graph.py ├── test_integer_graph.py ├── test_shortest_path.py └── test_fault_diagnosis.py ├── readme ├── logo_grape_resized.pdf └── logo_grape_resized.png ├── tutorials ├── tutorial03 │ ├── input_files │ │ ├── switch_state.png │ │ ├── switch_state_alltrue.png │ │ ├── TOY_graph.csv │ │ └── switch_line.csv │ ├── output_files │ │ ├── check_import_nodes.csv │ │ ├── check_import_edges.csv │ │ ├── service_paths_element_perturbation.csv │ │ └── element_perturbation.csv │ └── 03_switch_activation.py ├── tutorial01 │ ├── output_files │ │ ├── check_import_nodes.csv │ │ ├── check_import_edges.csv │ │ ├── service_paths_element_perturbation.csv │ │ ├── element_perturbation.csv │ │ └── results_generations.dat │ ├── input_files │ │ └── TOY_graph.csv │ └── 01_element_perturbation.py ├── tutorial02 │ ├── output_files │ │ ├── check_import_nodes.csv │ │ ├── check_import_edges.csv │ │ ├── service_paths_element_perturbation.csv │ │ ├── element_perturbation.csv │ │ └── results_generations.dat │ ├── input_files │ │ └── TOY_graph.csv │ └── 02_multi_element_perturbation.py └── README.md ├── .gitignore ├── grape ├── __init__.py ├── utils.py └── meta.py ├── .github ├── ISSUE_TEMPLATE │ ├── help-wanted.md │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── sphinx-build.yml │ ├── pypi-publish.yml │ ├── testing_pr.yml │ └── ci.yml ├── LICENSE ├── code_formatter.sh ├── .travis.yml ├── setup.py └── README.md /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.checkignore: -------------------------------------------------------------------------------- 1 | # Ignore folder content 2 | tests/* -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | tutorials/** linguist-vendored=true 2 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | import matplotlib 2 | 3 | matplotlib.use('Agg') 4 | -------------------------------------------------------------------------------- /docs/source/LICENSE.rst: -------------------------------------------------------------------------------- 1 | License 2 | ============== 3 | 4 | .. include:: ../../LICENSE 5 | -------------------------------------------------------------------------------- /readme/logo_grape_resized.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/GRAPE/HEAD/readme/logo_grape_resized.pdf -------------------------------------------------------------------------------- /readme/logo_grape_resized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/GRAPE/HEAD/readme/logo_grape_resized.png -------------------------------------------------------------------------------- /tests/TOY_graph_one_node.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark,init_status,description,type,weight,initial_service 2 | "1","NULL",,,"SOURCE",1.0,1.0 3 | -------------------------------------------------------------------------------- /tutorials/tutorial03/input_files/switch_state.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/GRAPE/HEAD/tutorials/tutorial03/input_files/switch_state.png -------------------------------------------------------------------------------- /tutorials/tutorial03/input_files/switch_state_alltrue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mathLab/GRAPE/HEAD/tutorials/tutorial03/input_files/switch_state_alltrue.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # mac file systems 2 | .DS_Store 3 | 4 | # compiled python codes 5 | *.pyc 6 | 7 | build/ 8 | dist/ 9 | grape.egg-info/ 10 | grape/__pycache__/ 11 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.utils.chunk_it.rst: -------------------------------------------------------------------------------- 1 | grape.utils.chunk\_it 2 | ===================== 3 | 4 | .. currentmodule:: grape.utils 5 | 6 | .. autofunction:: chunk_it -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/source/contact.rst: -------------------------------------------------------------------------------- 1 | Contact 2 | ======= 3 | 4 | Feel free to contact the authors for any informations. 5 | 6 | - auroramaurizio1@gmail.com 7 | - teruzzi.martina@gmail.com 8 | - demo.nicola@gmail.com 9 | -------------------------------------------------------------------------------- /docs/source/code.rst: -------------------------------------------------------------------------------- 1 | Code Documentation 2 | ======================= 3 | 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | 9 | general_graph 10 | parallel_general_graph 11 | fault_diagnosis 12 | utils 13 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.area.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.area 2 | ====================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.area -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.load.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.load 2 | ====================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.load -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.mark.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.mark 2 | ====================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.mark -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.type.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.type 2 | ====================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.type -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.users.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.users 2 | ======================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.users -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.weight.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.weight 2 | ======================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.weight -------------------------------------------------------------------------------- /docs/source/utils.rst: -------------------------------------------------------------------------------- 1 | utils 2 | ===================== 3 | 4 | .. currentmodule:: grape.utils 5 | 6 | .. automodule:: grape.utils 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | chunk_it 13 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.service.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.service 2 | ========================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.service -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.sources.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.sources 2 | ========================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.sources -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.switches.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.switches 2 | ========================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.switches -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.clear_data.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.clear\_data 2 | ============================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.clear_data -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.efficiency 2 | ============================================ 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.description.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.description 2 | ============================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.description -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.init_status.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.init\_status 2 | ============================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.init_status -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.mark_status.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.mark\_status 2 | ============================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.mark_status -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.status_area.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.status\_area 2 | ============================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.status_area -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.optimizer.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.optimizer 2 | =============================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.optimizer -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.rm_nodes.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.rm\_nodes 2 | =============================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.rm_nodes -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.final_status.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.final\_status 2 | =============================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.final_status -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.shortest_path.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.shortest\_path 2 | ================================================ 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.shortest_path -------------------------------------------------------------------------------- /tutorials/tutorial01/output_files/check_import_nodes.csv: -------------------------------------------------------------------------------- 1 | mark,description,init_status 2 | 1,, 3 | 2,,1 4 | 3,,1 5 | 4,, 6 | 5,, 7 | 6,, 8 | 7,, 9 | 8,, 10 | 9,, 11 | 15,, 12 | 16,, 13 | 17,, 14 | 10,, 15 | 11,, 16 | 19,, 17 | 12,, 18 | 13,, 19 | 14,, 20 | 18,, 21 | -------------------------------------------------------------------------------- /tutorials/tutorial02/output_files/check_import_nodes.csv: -------------------------------------------------------------------------------- 1 | mark,description,init_status 2 | 1,, 3 | 2,,1 4 | 3,,1 5 | 4,, 6 | 5,, 7 | 6,, 8 | 7,, 9 | 8,, 10 | 9,, 11 | 15,, 12 | 16,, 13 | 17,, 14 | 10,, 15 | 11,, 16 | 19,, 17 | 12,, 18 | 13,, 19 | 14,, 20 | 18,, 21 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_service.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_service 2 | ================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_service -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.father_condition.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.father\_condition 2 | =================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.father_condition -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.initial_service.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.initial\_service 2 | ================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.initial_service -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.local_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.local\_efficiency 2 | =================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.local_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.nodal_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.nodal\_efficiency 2 | =================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.nodal_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.delete_a_node.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.delete\_a\_node 2 | ===================================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.delete_a_node -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.update_output.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.update\_output 2 | ==================================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.update_output -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.degree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.degree\_centrality 2 | ==================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.degree_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.efficiency_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.efficiency\_kernel 2 | ==================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.efficiency_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.global_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.global\_efficiency 2 | ==================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.global_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_efficiency 2 | ===================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.indegree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.indegree\_centrality 2 | ====================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.indegree_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.closeness_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.closeness\_centrality 2 | ======================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.closeness_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.construct_path_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.construct\_path\_kernel 2 | ========================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.construct_path_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.floyd_warshall_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.floyd\_warshall\_kernel 2 | ========================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.floyd_warshall_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.outdegree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.outdegree\_centrality 2 | ======================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.outdegree_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.shortest_path_length.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.shortest\_path\_length 2 | ======================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.shortest_path_length -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.apply_perturbation.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.apply\_perturbation 2 | ========================================================= 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.apply_perturbation -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.fitness_evaluation.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.fitness\_evaluation 2 | ========================================================= 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.fitness_evaluation -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.betweenness_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.betweenness\_centrality 2 | ========================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.betweenness_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.perturbation_resistant.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.perturbation\_resistant 2 | ========================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoproperty:: GeneralGraph.perturbation_resistant -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.update_status_areas.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.update\_status\_areas 2 | =========================================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.update_status_areas -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.calculate_shortest_path.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.calculate\_shortest\_path 2 | =========================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.calculate_shortest_path -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.local_efficiency_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.local\_efficiency\_kernel 2 | =========================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.local_efficiency_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.nodal_efficiency_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.nodal\_efficiency\_kernel 2 | =========================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.nodal_efficiency_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_local_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_local\_efficiency 2 | ============================================================ 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_local_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_nodal_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_nodal\_efficiency 2 | ============================================================ 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_nodal_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.degree_centrality_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.degree\_centrality\_kernel 2 | ============================================================ 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.degree_centrality_kernel -------------------------------------------------------------------------------- /grape/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | GRAPE init 3 | """ 4 | __all__ = ['general_graph', 'parallel_general_graph', 'fault_diagnosis'] 5 | 6 | 7 | from .meta import * 8 | from .general_graph import GeneralGraph 9 | from .parallel_general_graph import ParallelGeneralGraph 10 | from .fault_diagnosis import FaultDiagnosis 11 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_degree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_degree\_centrality 2 | ============================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_degree_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.indegree_centrality_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.indegree\_centrality\_kernel 2 | ============================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.indegree_centrality_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.shortest_path_list_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.shortest\_path\_list\_kernel 2 | ============================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.shortest_path_list_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.check_input_with_gephi.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.check\_input\_with\_gephi 2 | =============================================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.check_input_with_gephi -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.closeness_centrality_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.closeness\_centrality\_kernel 2 | =============================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.closeness_centrality_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_indegree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_indegree\_centrality 2 | =============================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_indegree_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.outdegree_centrality_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.outdegree\_centrality\_kernel 2 | =============================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.outdegree_centrality_kernel -------------------------------------------------------------------------------- /tests/general_graph.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | from .grape import GeneralGraph 3 | 4 | 5 | class TestGeneralGraph(TestCase): 6 | """ 7 | Class TestGeneralGraph to check creating an instance of 8 | GeneralGraph object 9 | """ 10 | def create_instance(self): 11 | GeneralGraph() 12 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.check_paths_and_measures.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.check\_paths\_and\_measures 2 | ================================================================= 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.check_paths_and_measures -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_closeness_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_closeness\_centrality 2 | ================================================================ 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_closeness_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_outdegree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_outdegree\_centrality 2 | ================================================================ 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_outdegree_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.betweenness_centrality_kernel.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.betweenness\_centrality\_kernel 2 | ================================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.betweenness_centrality_kernel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.floyd_warshall_initialization.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.floyd\_warshall\_initialization 2 | ================================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.floyd_warshall_initialization -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.fitness_evaluation_parallel.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.fitness\_evaluation\_parallel 2 | =================================================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.fitness_evaluation_parallel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.fitness_iteration_parallel.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.fitness\_iteration\_parallel 2 | ================================================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.fitness_iteration_parallel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.simulate_area_perturbation.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.simulate\_area\_perturbation 2 | ================================================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.simulate_area_perturbation -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.compute_betweenness_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.compute\_betweenness\_centrality 2 | ================================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.compute_betweenness_centrality -------------------------------------------------------------------------------- /tutorials/tutorial03/output_files/check_import_nodes.csv: -------------------------------------------------------------------------------- 1 | mark,description,init_status 2 | 10,, 3 | 11,, 4 | 12,, 5 | 13,, 6 | 14,, 7 | 1,, 8 | S1,,1 9 | 2,, 10 | S2,,1 11 | 3,, 12 | S3,,1 13 | 4,, 14 | S4,,1 15 | 5,, 16 | S5,,1 17 | 6,, 18 | 6,,1 19 | S6,,1 20 | 7,, 21 | S7,,1 22 | 8,, 23 | S8,,1 24 | 9,, 25 | B,, 26 | A,, 27 | C,, 28 | -------------------------------------------------------------------------------- /tutorials/tutorial01/output_files/check_import_edges.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark 2 | 2,1 3 | 3,1 4 | 4,2 5 | 5,3 6 | 6,4 7 | 6,7 8 | 7,6 9 | 8,6 10 | 6,8 11 | 9,8 12 | 9,15 13 | 16,9 14 | 16,17 15 | 17,16 16 | 10,17 17 | 11,10 18 | 11,5 19 | 19,11 20 | 19,12 21 | 19,14 22 | 12,19 23 | 12,13 24 | 13,14 25 | 13,12 26 | 14,19 27 | 14,13 28 | 18,14 29 | -------------------------------------------------------------------------------- /tutorials/tutorial02/output_files/check_import_edges.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark 2 | 2,1 3 | 3,1 4 | 4,2 5 | 5,3 6 | 6,4 7 | 6,7 8 | 7,6 9 | 8,6 10 | 6,8 11 | 9,8 12 | 9,15 13 | 16,9 14 | 16,17 15 | 17,16 16 | 10,17 17 | 11,10 18 | 11,5 19 | 19,11 20 | 19,12 21 | 19,14 22 | 12,19 23 | 12,13 24 | 13,14 25 | 13,12 26 | 14,19 27 | 14,13 28 | 18,14 29 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.simulate_element_perturbation.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.simulate\_element\_perturbation 2 | ===================================================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.simulate_element_perturbation -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.graph_characterization_to_file.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis.graph\_characterization\_to\_file 2 | ======================================================================= 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automethod:: FaultDiagnosis.graph_characterization_to_file -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.measure_iteration.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.measure\_iteration 2 | ====================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.measure_iteration -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.measure_processes.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.measure\_processes 2 | ====================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.measure_processes -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.compute_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.compute\_efficiency 2 | ======================================================================= 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.compute_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.dijkstra_single_source_shortest_path.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.dijkstra\_single\_source\_shortest\_path 2 | ========================================================================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.dijkstra_single_source_shortest_path -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.floyd_warshall_predecessor_and_distance.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph.floyd\_warshall\_predecessor\_and\_distance 2 | ============================================================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automethod:: GeneralGraph.floyd_warshall_predecessor_and_distance -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.calculate_shortest_path.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.calculate\_shortest\_path 2 | ============================================================================= 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.calculate_shortest_path -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.compute_local_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.compute\_local\_efficiency 2 | ============================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.compute_local_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.compute_nodal_efficiency.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.compute\_nodal\_efficiency 2 | ============================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.compute_nodal_efficiency -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.compute_degree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.compute\_degree\_centrality 2 | =============================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.compute_degree_centrality -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/help-wanted.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Help wanted 3 | about: Ask help for using the package 4 | title: '' 5 | labels: help wanted 6 | assignees: '' 7 | 8 | --- 9 | 10 | **The objective** 11 | A clear description of the purpose of your application. 12 | 13 | **Already tried tests** 14 | The snippet of code you have already tried in order to obtain the wanted outcome. 15 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.compute_indegree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.compute\_indegree\_centrality 2 | ================================================================================= 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.compute_indegree_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.dijkstra_iteration_parallel.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.dijkstra\_iteration\_parallel 2 | ================================================================================= 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.dijkstra_iteration_parallel -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.compute_closeness_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.compute\_closeness\_centrality 2 | ================================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.compute_closeness_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.compute_outdegree_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.compute\_outdegree\_centrality 2 | ================================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.compute_outdegree_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.shortest_path_list_iteration.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.shortest\_path\_list\_iteration 2 | =================================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.shortest_path_list_iteration -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.compute_betweenness_centrality.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.compute\_betweenness\_centrality 2 | ==================================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.compute_betweenness_centrality -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.dijkstra_single_source_shortest_path.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.dijkstra\_single\_source\_shortest\_path 2 | ============================================================================================ 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.dijkstra_single_source_shortest_path -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.floyd_warshall_predecessor_and_distance.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph.floyd\_warshall\_predecessor\_and\_distance 2 | =============================================================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automethod:: ParallelGeneralGraph.floyd_warshall_predecessor_and_distance -------------------------------------------------------------------------------- /tutorials/tutorial03/output_files/check_import_edges.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark 2 | 10,1 3 | 11,3 4 | 12,5 5 | 13,7 6 | 14,9 7 | 1,A 8 | 1,S1 9 | S1,1 10 | S1,2 11 | 2,S1 12 | 2,S2 13 | S2,2 14 | S2,3 15 | 3,S2 16 | 3,S3 17 | S3,3 18 | S3,4 19 | 4,S3 20 | 4,S4 21 | S4,4 22 | S4,5 23 | 5,B 24 | 5,S4 25 | 5,S5 26 | S5,5 27 | S5,6 28 | 6,S5 29 | 6,S6 30 | S6,6 31 | S6,7 32 | 7,C 33 | 7,S6 34 | 7,S7 35 | S7,7 36 | S7,8 37 | 8,S7 38 | 8,S8 39 | S8,8 40 | S8,9 41 | 9,S8 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | The piece of code that reproduce the bug. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Output** 20 | The obtained output. Please include the entire error trace. 21 | 22 | **Additional context** 23 | Add any other context about the problem here. 24 | -------------------------------------------------------------------------------- /grape/utils.py: -------------------------------------------------------------------------------- 1 | """Utility functions module""" 2 | 3 | 4 | def chunk_it(elements, n_procs): 5 | """ 6 | 7 | Divide elements in chunks according to number of processes. 8 | 9 | :param list elements: list of elements to be divided in chunks 10 | :param int n_procs: number of available processes 11 | 12 | :return: list of elements to be assigned to every process 13 | :rtype: list 14 | """ 15 | 16 | avg = len(elements) / n_procs 17 | out = [] 18 | last = 0.0 19 | 20 | while last < len(elements): 21 | out.append(elements[int(last):int(last + avg)]) 22 | last += avg 23 | return out 24 | -------------------------------------------------------------------------------- /tutorials/tutorial02/output_files/service_paths_element_perturbation.csv: -------------------------------------------------------------------------------- 1 | from,to,original_shortest_path_length,original_shortest_path,original_simple_path,original_pair_efficiency,ids 2 | 1,18,6.0,"['1', '3', '5', '11', '19', '14', '18']","[['1', '2', '4', '6', '8', '9', '16', '17', '10', '11', '19', '12', '13', '14', '18'], ['1', '2', '4', '6', '8', '9', '16', '17', '10', '11', '19', '14', '18'], ['1', '3', '5', '11', '19', '12', '13', '14', '18'], ['1', '3', '5', '11', '19', '14', '18']]",0.16666666666666666,118 3 | 15,18,8.0,"['15', '9', '16', '17', '10', '11', '19', '14', '18']","[['15', '9', '16', '17', '10', '11', '19', '12', '13', '14', '18'], ['15', '9', '16', '17', '10', '11', '19', '14', '18']]",0.125,1518 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /tutorials/README.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | 3 | In this folder you can find a collection of useful Notebooks containing tutorials to understand the principles and the potential of **GRAPE**. 4 | 5 | #### Tutorial 1 [[.ipynb](tutorial01/01_element_perturbation.ipynb), [.py](tutorial01/01_element_perturbation.py)] 6 | Here we show the perturbation of one element in a toy graph. 7 | 8 | #### Tutorial 2 [[.ipynb](tutorial02/02_multi_element_perturbation.ipynb), [.py](tutorial02/02_multi_element_perturbation.py)] 9 | Here we show the perturbation of multiple elements in a toy graph. 10 | 11 | #### Tutorial 3 [[.ipynb](tutorial03/03_switch_activation.ipynb), [.py](tutorial03/03_switch_activation.py)] 12 | Here we describe how switch activation works. 13 | -------------------------------------------------------------------------------- /.github/workflows/sphinx-build.yml: -------------------------------------------------------------------------------- 1 | name: "Pull Request Docs Check" 2 | 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | 8 | jobs: 9 | docs: 10 | runs-on: ubuntu-18.04 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Create the new documentation 15 | uses: ammaraskar/sphinx-action@master 16 | with: 17 | pre-build-command: "python -m pip install pip sphinx_rtd_theme networkx numpy scipy future matplotlib pandas deap -U" 18 | docs-folder: "docs/" 19 | 20 | - name: Deploy 21 | uses: peaceiris/actions-gh-pages@v3 22 | with: 23 | github_token: ${{ secrets.GITHUB_TOKEN }} 24 | #deploy_key: ${{ secrets.DEPLOY_PRIVATE_KEY }} 25 | publish_dir: ./docs/build/html 26 | allow_empty_commit: true 27 | -------------------------------------------------------------------------------- /.github/workflows/pypi-publish.yml: -------------------------------------------------------------------------------- 1 | name: "PYPI Publish" 2 | 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | 8 | jobs: 9 | docs: 10 | runs-on: ubuntu-18.04 11 | steps: 12 | - uses: actions/checkout@v2 13 | 14 | - name: Set up Python 3.7 15 | uses: actions/setup-python@v1 16 | with: 17 | python-version: 3.7 18 | 19 | - name: Install build 20 | run: >- 21 | python -m pip install build --user 22 | 23 | - name: Build a binary wheel and a source tarball 24 | run: >- 25 | python -m build --sdist --wheel --outdir dist/ . 26 | 27 | - name: Publish distribution to PyPI 28 | if: startsWith(github.ref, 'refs/tags') 29 | uses: pypa/gh-action-pypi-publish@master 30 | with: 31 | password: ${{ secrets.PYPI }} 32 | -------------------------------------------------------------------------------- /.github/workflows/testing_pr.yml: -------------------------------------------------------------------------------- 1 | name: "Testing Pull Request" 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - "master" 7 | 8 | 9 | jobs: 10 | build: 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | os: [windows-latest, macos-latest, ubuntu-latest] 16 | python-version: [3.7, 3.8] 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | 21 | 22 | - name: Set up Python 23 | uses: actions/setup-python@v2 24 | with: 25 | python-version: ${{ matrix.python-version }} 26 | 27 | - name: Install Python dependencies 28 | run: | 29 | python3 -m pip install --upgrade pip 30 | python3 -m pip install .[test] 31 | 32 | - name: Test with pytest 33 | run: | 34 | python3 -m pytest 35 | -------------------------------------------------------------------------------- /grape/meta.py: -------------------------------------------------------------------------------- 1 | """Package information""" 2 | 3 | def get_current_year(): 4 | """ Return current year """ 5 | from datetime import datetime 6 | return datetime.now().year 7 | 8 | __all__ = [ 9 | '__project__', 10 | '__title__', 11 | '__author__', 12 | '__copyright__', 13 | '__license__', 14 | '__version__', 15 | '__mail__', 16 | '__maintainer__', 17 | '__status__', 18 | '__packagename__'] 19 | 20 | __project__ = 'GRAPE' 21 | __packagename__ = 'grape-mathlab' 22 | __project__ = 'GRAPE' 23 | __title__ = "grape" 24 | __author__ = "Aurora Maurizio, Martina Teruzzi, Nicola Demo" 25 | __copyright__ = "Copyright 2019-{}, GRAPE contributors".format(get_current_year()) 26 | __license__ = "MIT" 27 | __version__ = "2.0.0" 28 | __mail__ = 'auroramaurizio1@gmail.com, teruzzi.martina@gmail.com, demo.nicola@gmail.com' 29 | __maintainer__ = __author__ 30 | __status__ = "Alpha" 31 | -------------------------------------------------------------------------------- /tests/TOY_graph.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark,init_status,description,type,weight,initial_service 2 | "1","NULL",,,"SOURCE",1.0,1.0 3 | "2","1",1,,"SWITCH",1.0,0.0 4 | "3","1",1,,"SWITCH",1.0,0.0 5 | "4","2",,,"HUB",1.0,0.0 6 | "5","3",,,"HUB",1.0,0.0 7 | "6","4",,,"HUB",1.0,0.0 8 | "6","7",,,"HUB",1.0,0.0 9 | "7","6",,,"HUB",1.0,0.0 10 | "8","6",,,"HUB",1.0,0.0 11 | "6","8",,,"HUB",1.0,0.0 12 | "9","8",,,"HUB",1.0,0.0 13 | "9","15",,,"HUB",1.0,0.0 14 | "15","NULL",,,"SOURCE",1.0,2.0 15 | "16","9",,,"HUB",1.0,0.0 16 | "16","17",,,"HUB",1.0,0.0 17 | "17","16",,,"HUB",1.0,0.0 18 | "10","17",,,"HUB",1.0,0.0 19 | "11","10",,,"HUB",1.0,0.0 20 | "11","5",,,"HUB",1.0,0.0 21 | "19","11",,,"HUB",1.0,0.0 22 | "19","12",,,"HUB",1.0,0.0 23 | "19","14",,,"HUB",1.0,0.0 24 | "12","19",,,"HUB",1.0,0.0 25 | "12","13",,,"HUB",1.0,0.0 26 | "13","14",,,"HUB",1.0,0.0 27 | "13","12",,,"HUB",1.0,0.0 28 | "14","19",,,"HUB",1.0,0.0 29 | "14","13",,,"HUB",1.0,0.0 30 | "18","14",,,"USER",1.0,0.0 31 | -------------------------------------------------------------------------------- /tutorials/tutorial01/output_files/service_paths_element_perturbation.csv: -------------------------------------------------------------------------------- 1 | from,to,original_shortest_path_length,original_shortest_path,original_simple_path,original_pair_efficiency,ids,final_shortest_path_length,final_shortest_path,final_simple_path,final_pair_efficiency 2 | 1,18,6.0,"['1', '3', '5', '11', '19', '14', '18']","[['1', '2', '4', '6', '8', '9', '16', '17', '10', '11', '19', '12', '13', '14', '18'], ['1', '2', '4', '6', '8', '9', '16', '17', '10', '11', '19', '14', '18'], ['1', '3', '5', '11', '19', '12', '13', '14', '18'], ['1', '3', '5', '11', '19', '14', '18']]",0.16666666666666666,118,,,, 3 | 15,18,8.0,"['15', '9', '16', '17', '10', '11', '19', '14', '18']","[['15', '9', '16', '17', '10', '11', '19', '12', '13', '14', '18'], ['15', '9', '16', '17', '10', '11', '19', '14', '18']]",0.125,1518,8.0,"['15', '9', '16', '17', '10', '11', '19', '14', '18']","[['15', '9', '16', '17', '10', '11', '19', '12', '13', '14', '18'], ['15', '9', '16', '17', '10', '11', '19', '14', '18']]",0.125 4 | -------------------------------------------------------------------------------- /tutorials/tutorial01/input_files/TOY_graph.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark,init_status,description,type,weight,initial_service 2 | "1","NULL",,,"SOURCE",1.0,1.0 3 | "2","1",1,,"SWITCH",1.0,0.0 4 | "3","1",1,,"SWITCH",1.0,0.0 5 | "4","2",,,"HUB",1.0,0.0 6 | "5","3",,,"HUB",1.0,0.0 7 | "6","4",,,"HUB",1.0,0.0 8 | "6","7",,,"HUB",1.0,0.0 9 | "7","6",,,"HUB",1.0,0.0 10 | "8","6",,,"HUB",1.0,0.0 11 | "6","8",,,"HUB",1.0,0.0 12 | "9","8",,,"HUB",1.0,0.0 13 | "9","15",,,"HUB",1.0,0.0 14 | "15","NULL",,,"SOURCE",1.0,2.0 15 | "16","9",,,"HUB",1.0,0.0 16 | "16","17",,,"HUB",1.0,0.0 17 | "17","16",,,"HUB",1.0,0.0 18 | "10","17",,,"HUB",1.0,0.0 19 | "11","10",,,"HUB",1.0,0.0 20 | "11","5",,,"HUB",1.0,0.0 21 | "19","11",,,"HUB",1.0,0.0 22 | "19","12",,,"HUB",1.0,0.0 23 | "19","14",,,"HUB",1.0,0.0 24 | "12","19",,,"HUB",1.0,0.0 25 | "12","13",,,"HUB",1.0,0.0 26 | "13","14",,,"HUB",1.0,0.0 27 | "13","12",,,"HUB",1.0,0.0 28 | "14","19",,,"HUB",1.0,0.0 29 | "14","13",,,"HUB",1.0,0.0 30 | "18","14",,,"USER",1.0,0.0 31 | -------------------------------------------------------------------------------- /tutorials/tutorial02/input_files/TOY_graph.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark,init_status,description,type,weight,initial_service 2 | "1","NULL",,,"SOURCE",1.0,1.0 3 | "2","1",1,,"SWITCH",1.0,0.0 4 | "3","1",1,,"SWITCH",1.0,0.0 5 | "4","2",,,"HUB",1.0,0.0 6 | "5","3",,,"HUB",1.0,0.0 7 | "6","4",,,"HUB",1.0,0.0 8 | "6","7",,,"HUB",1.0,0.0 9 | "7","6",,,"HUB",1.0,0.0 10 | "8","6",,,"HUB",1.0,0.0 11 | "6","8",,,"HUB",1.0,0.0 12 | "9","8",,,"HUB",1.0,0.0 13 | "9","15",,,"HUB",1.0,0.0 14 | "15","NULL",,,"SOURCE",1.0,2.0 15 | "16","9",,,"HUB",1.0,0.0 16 | "16","17",,,"HUB",1.0,0.0 17 | "17","16",,,"HUB",1.0,0.0 18 | "10","17",,,"HUB",1.0,0.0 19 | "11","10",,,"HUB",1.0,0.0 20 | "11","5",,,"HUB",1.0,0.0 21 | "19","11",,,"HUB",1.0,0.0 22 | "19","12",,,"HUB",1.0,0.0 23 | "19","14",,,"HUB",1.0,0.0 24 | "12","19",,,"HUB",1.0,0.0 25 | "12","13",,,"HUB",1.0,0.0 26 | "13","14",,,"HUB",1.0,0.0 27 | "13","12",,,"HUB",1.0,0.0 28 | "14","19",,,"HUB",1.0,0.0 29 | "14","13",,,"HUB",1.0,0.0 30 | "18","14",,,"USER",1.0,0.0 31 | -------------------------------------------------------------------------------- /tutorials/tutorial03/input_files/TOY_graph.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark,init_status,description,type,weight,initial_service 2 | "1","NULL",,,"SOURCE",1.0,1.0 3 | "2","1",1,,"SWITCH",1.0,0.0 4 | "3","1",1,,"SWITCH",1.0,0.0 5 | "4","2",,,"HUB",1.0,0.0 6 | "5","3",,,"HUB",1.0,0.0 7 | "6","4",,,"HUB",1.0,0.0 8 | "6","7",,,"HUB",1.0,0.0 9 | "7","6",,,"HUB",1.0,0.0 10 | "8","6",,,"HUB",1.0,0.0 11 | "6","8",,,"HUB",1.0,0.0 12 | "9","8",,,"HUB",1.0,0.0 13 | "9","15",,,"HUB",1.0,0.0 14 | "15","NULL",,,"SOURCE",1.0,2.0 15 | "16","9",,,"HUB",1.0,0.0 16 | "16","17",,,"HUB",1.0,0.0 17 | "17","16",,,"HUB",1.0,0.0 18 | "10","17",,,"HUB",1.0,0.0 19 | "11","10",,,"HUB",1.0,0.0 20 | "11","5",,,"HUB",1.0,0.0 21 | "19","11",,,"HUB",1.0,0.0 22 | "19","12",,,"HUB",1.0,0.0 23 | "19","14",,,"HUB",1.0,0.0 24 | "12","19",,,"HUB",1.0,0.0 25 | "12","13",,,"HUB",1.0,0.0 26 | "13","14",,,"HUB",1.0,0.0 27 | "13","12",,,"HUB",1.0,0.0 28 | "14","19",,,"HUB",1.0,0.0 29 | "14","13",,,"HUB",1.0,0.0 30 | "18","14",,,"USER",1.0,0.0 31 | -------------------------------------------------------------------------------- /docs/source/fault_diagnosis.rst: -------------------------------------------------------------------------------- 1 | FaultDiagnosis 2 | ===================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. automodule:: grape.fault_diagnosis 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | FaultDiagnosis 13 | FaultDiagnosis.check_input_with_gephi 14 | FaultDiagnosis.fitness_iteration_parallel 15 | FaultDiagnosis.fitness_evaluation_parallel 16 | FaultDiagnosis.fitness_evaluation 17 | FaultDiagnosis.optimizer 18 | FaultDiagnosis.check_paths_and_measures 19 | FaultDiagnosis.rm_nodes 20 | FaultDiagnosis.update_output 21 | FaultDiagnosis.update_status_areas 22 | FaultDiagnosis.delete_a_node 23 | FaultDiagnosis.apply_perturbation 24 | FaultDiagnosis.simulate_element_perturbation 25 | FaultDiagnosis.simulate_area_perturbation 26 | FaultDiagnosis.graph_characterization_to_file 27 | 28 | .. autoclass:: FaultDiagnosis 29 | :members: 30 | :private-members: 31 | :undoc-members: 32 | :show-inheritance: 33 | :noindex: 34 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: "Coverage Deploy to Codacy" 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | test_deploy: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v2 18 | with: 19 | python-version: 3.8 20 | 21 | - name: Install Python dependencies 22 | run: | 23 | python3 -m pip install --upgrade pip 24 | python3 -m pip install numpy scipy matplotlib pytest pytest-cov future networkx pandas deap 25 | 26 | - name: Test with pytest 27 | env: 28 | CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }} 29 | shell: bash 30 | run: | 31 | python3 -m pytest --cov-report term --cov-report xml:cobertura.xml --cov=grape 32 | curl -s https://coverage.codacy.com/get.sh -o CodacyCoverageReporter.sh 33 | chmod +x CodacyCoverageReporter.sh 34 | ./CodacyCoverageReporter.sh report -r cobertura.xml -t $CODACY_API_TOKEN 35 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.fault_diagnosis.FaultDiagnosis.rst: -------------------------------------------------------------------------------- 1 | grape.fault\_diagnosis.FaultDiagnosis 2 | ===================================== 3 | 4 | .. currentmodule:: grape.fault_diagnosis 5 | 6 | .. autoclass:: FaultDiagnosis 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~FaultDiagnosis.__init__ 17 | ~FaultDiagnosis.apply_perturbation 18 | ~FaultDiagnosis.check_input_with_gephi 19 | ~FaultDiagnosis.check_paths_and_measures 20 | ~FaultDiagnosis.delete_a_node 21 | ~FaultDiagnosis.fitness_evaluation 22 | ~FaultDiagnosis.fitness_evaluation_parallel 23 | ~FaultDiagnosis.fitness_iteration_parallel 24 | ~FaultDiagnosis.graph_characterization_to_file 25 | ~FaultDiagnosis.optimizer 26 | ~FaultDiagnosis.rm_nodes 27 | ~FaultDiagnosis.simulate_area_perturbation 28 | ~FaultDiagnosis.simulate_element_perturbation 29 | ~FaultDiagnosis.update_output 30 | ~FaultDiagnosis.update_status_areas 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /tutorials/tutorial01/01_element_perturbation.py: -------------------------------------------------------------------------------- 1 | from grape.fault_diagnosis import FaultDiagnosis 2 | 3 | F = FaultDiagnosis("./input_files/TOY_graph.csv") 4 | 5 | initial = { '11': (2., 2.), '19': (6., 2.), '12': (10., 2.), 6 | '14': (6., 10.), '13': (10., 10.), '18': (2., 10.), '5': (-2., 2.), 7 | '3': (-4., 6.), '1': (-6., 10.), '2': (-8., 6.), '4': (-10., 2.), 8 | '6': (-6., -2.), '7': (-10, -10.), '8': (-2, -10.), '10': (2., -2.), 9 | '17': (10., -2.), '16': (10., -10.), '9': (2., -10.), '15': (6., -6.)} 10 | 11 | F.G.print_graph(initial_pos=initial, size=800, edge_width=3., arrow_size=7, 12 | fsize=12, fixed_nodes=list(F.G), title='TOY graph (integer)', 13 | legend_loc='upper center', legend_ncol=4, 14 | legend_anchor=(0.5, 1.2), legend_fsize=12) 15 | 16 | F.check_input_with_gephi() 17 | F.simulate_element_perturbation(["1"]) 18 | 19 | F.G.print_graph(initial_pos=initial, size=800, edge_width=3., arrow_size=7, 20 | fsize=12, fixed_nodes=list(F.G), title='TOY graph (perturbed)', 21 | legend_loc='upper center', legend_ncol=4, 22 | legend_anchor=(0.5, 1.2), legend_fsize=12) 23 | -------------------------------------------------------------------------------- /tutorials/tutorial02/02_multi_element_perturbation.py: -------------------------------------------------------------------------------- 1 | from grape.fault_diagnosis import FaultDiagnosis 2 | 3 | F = FaultDiagnosis("./input_files/TOY_graph.csv") 4 | 5 | initial = { '11': (2., 2.), '19': (6., 2.), '12': (10., 2.), 6 | '14': (6., 10.), '13': (10., 10.), '18': (2., 10.), '5': (-2., 2.), 7 | '3': (-4., 6.), '1': (-6., 10.), '2': (-8., 6.), '4': (-10., 2.), 8 | '6': (-6., -2.), '7': (-10, -10.), '8': (-2, -10.), '10': (2., -2.), 9 | '17': (10., -2.), '16': (10., -10.), '9': (2., -10.), '15': (6., -6.)} 10 | 11 | F.G.print_graph(initial_pos=initial, size=800, edge_width=3., arrow_size=7, 12 | fsize=12, fixed_nodes=list(F.G), title='TOY graph (integer)', 13 | legend_loc='upper center', legend_ncol=4, legend_anchor=(0.5, 1.2), 14 | legend_fsize=12) 15 | 16 | F.check_input_with_gephi() 17 | F.simulate_element_perturbation(["1", "2"]) 18 | 19 | F.G.print_graph(initial_pos=initial, size=800, edge_width=3., arrow_size=7, 20 | fsize=12, fixed_nodes=list(F.G), title='TOY graph (perturbed)', 21 | legend_loc='upper center', legend_ncol=4, 22 | legend_anchor=(0.5, 1.2), legend_fsize=12) 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 SISSA mathLab 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /tutorials/tutorial03/input_files/switch_line.csv: -------------------------------------------------------------------------------- 1 | mark,father_mark,init_status,description,type,weight,initial_service 2 | "10","1",,,USER,1,0 3 | "11","3",,,USER,1,0 4 | "12","5",,,USER,1,0 5 | "13","7",,,USER,1,0 6 | "14","9",,,USER,1,0 7 | "1","A",,,HUB,1,0 8 | "1","S1",,,HUB,1,0 9 | "S1","1",1,,SWITCH,1,0 10 | "S1","2",1,,SWITCH,1,0 11 | "2","S1",,,HUB,1,0 12 | "2","S2",,,HUB,1,0 13 | "S2","2",1,,SWITCH,1,0 14 | "S2","3",1,,SWITCH,1,0 15 | "3","S2",,,HUB,1,0 16 | "3","S3",,,HUB,1,0 17 | "S3","3",1,,SWITCH,1,0 18 | "S3","4",1,,SWITCH,1,0 19 | "4","S3",,,HUB,1,0 20 | "4","S4",,,HUB,1,0 21 | "S4","4",1,,SWITCH,1,0 22 | "S4","5",1,,SWITCH,1,0 23 | "5","B",,,HUB,1,0 24 | "5","S4",,,HUB,1,0 25 | "5","S5",,,HUB,1,0 26 | "S5","5",1,,SWITCH,1,0 27 | "S5","6",1,,SWITCH,1,0 28 | "6","S5",,,HUB,1,0 29 | "6","S6",1,,HUB,1,0 30 | "S6","6",1,,SWITCH,1,0 31 | "S6","7",1,,SWITCH,1,0 32 | "7","C",,,HUB,1,0 33 | "7","S6",,,HUB,1,0 34 | "7","S7",,,HUB,1,0 35 | "S7","7",1,,SWITCH,1,0 36 | "S7","8",1,,SWITCH,1,0 37 | "8","S7",,,HUB,1,0 38 | "8","S8",,,HUB,1,0 39 | "S8","8",1,,SWITCH,1,0 40 | "S8","9",1,,SWITCH,1,0 41 | "9","S8",,,HUB,1,0 42 | "B",NULL,,,SOURCE,1,1 43 | "A",NULL,,,SOURCE,1,1 44 | "C",NULL,,,SOURCE,1,1 45 | -------------------------------------------------------------------------------- /code_formatter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ####################################### 4 | 5 | required_command="yapf unexpand" 6 | code_directories="grape tests" 7 | 8 | ####################################### 9 | 10 | usage() { 11 | echo 12 | echo -e "\tUsage: $0 [files]" 13 | echo 14 | echo -e "\tIf not files are specified, script formats all ".py" files" 15 | echo -e "\tin code directories ($code_directories); otherwise, formats" 16 | echo -e "\tall given files" 17 | echo 18 | echo -e "\tRequired command: $required_command" 19 | echo 20 | exit 0 21 | } 22 | 23 | 24 | [[ $1 == "-h" ]] && usage 25 | 26 | # Test for required program 27 | for comm in $required_command; do 28 | command -v $comm >/dev/null 2>&1 || { 29 | echo "I require $comm but it's not installed. Aborting." >&2; 30 | exit 1 31 | } 32 | done 33 | 34 | # Find all python files in code directories 35 | python_files="" 36 | for dir in $code_directories; do 37 | python_files="$python_files $(find $dir -name '*.py')" 38 | done 39 | [[ $# != 0 ]] && python_files=$@ 40 | 41 | 42 | # Here the important part: yapf format the files. 43 | for file in $python_files; do 44 | echo "Making beatiful $file..." 45 | [[ ! -f $file ]] && echo "$file does not exist; $0 -h for more info" && exit 46 | 47 | yapf --style='{ 48 | based_on_style: pep8, 49 | indent_width: 4, 50 | column_limit: 80 51 | }' -i $file 52 | done 53 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: true 2 | dist: trusty 3 | 4 | language: python 5 | 6 | matrix: 7 | include: 8 | - os: linux 9 | python: 3.6 10 | env: TOXENV=py36 11 | 12 | before_script: 13 | - "export DISPLAY=:99.0" 14 | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 15 | sh -e /etc/init.d/xvfb start; 16 | sleep 3; 17 | fi 18 | 19 | before_install: 20 | # We do this conditionally because it saves us some downloading if the 21 | # version is the same. 22 | - if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then 23 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; 24 | fi 25 | - python --version 26 | - chmod +x miniconda.sh 27 | - bash miniconda.sh -b -p $HOME/miniconda 28 | - export PATH="$HOME/miniconda/bin:$HOME/miniconda/lib:$PATH" 29 | - hash -r 30 | - conda config --set always_yes yes --set changeps1 no 31 | - conda update -q conda 32 | # Useful for debugging any issues with conda 33 | - conda info -a 34 | - conda config --add channels conda-forge 35 | 36 | install: 37 | - conda create --yes -n test python=$TRAVIS_PYTHON_VERSION 38 | - source activate test 39 | - pip install coverage numpy scipy matplotlib networkx nose coveralls pandas deap 40 | - python setup.py install 41 | 42 | script: 43 | - coverage run test.py 44 | 45 | after_success: 46 | - coveralls 47 | 48 | branches: 49 | only: 50 | - master 51 | -------------------------------------------------------------------------------- /docs/source/contributing.rst: -------------------------------------------------------------------------------- 1 | How to contribute 2 | =================== 3 | 4 | We'd love to accept your patches and contributions to this project. There are 5 | just a few small guidelines you need to follow. 6 | 7 | Submitting a patch: 8 | 9 | 1. It's generally best to start by opening a new issue describing the bug or feature you're intending to fix. Even if you think it's relatively minor, it's helpful to know what people are working on. Mention in the initial issue that you are planning to work on that bug or feature so that it can be assigned to you. 10 | 11 | 2. Follow the normal process of forking the project, and setup a new branch to work in. It's important that each group of changes be done in separate branches in order to ensure that a pull request only includes the commits related to that bug or feature. 12 | 13 | 3. To ensure properly formatted code, please make sure to use 4 spaces to indent the code. The easy way is to run on your bash the provided script: ./code_formatter.sh. You should also run pylint over your code. It's not strictly necessary that your code be completely "lint-free", but this will help you find common style issues. 14 | 15 | 4. Any significant changes should almost always be accompanied by tests. The project already has good test coverage, so look at some of the existing tests if you're unsure how to go about it. We're using coveralls that is an invaluable tools for seeing which parts of your code aren't being exercised by your tests. 16 | 17 | 5. Do your best to have well-formed commit messages for each change. This provides consistency throughout the project, and ensures that commit messages are able to be formatted properly by various git tools. 18 | 19 | 6. Finally, push the commits to your fork and submit a pull request. Please, remember to rebase properly in order to maintain a clean, linear git history. 20 | -------------------------------------------------------------------------------- /tutorials/tutorial03/03_switch_activation.py: -------------------------------------------------------------------------------- 1 | from grape.fault_diagnosis import FaultDiagnosis 2 | 3 | F = FaultDiagnosis("./input_files/switch_line.csv") 4 | F.check_input_with_gephi() 5 | 6 | initial = {'10': (0., 0.), '1': (0., 2.), 'A': (0., 4.), 7 | 'S1': (2., 2.), '2': (4., 2.), 'S2': (6., 2.), '3': (8., 2.), 8 | '11': (8., 0.), 'S3': (10., 2.), '4': (12., 2.), 'S4': (14., 2.), 9 | '5': (16., 2.), '12': (16., 0.), 'B': (16., 4.), 'S5': (18., 2.), 10 | '6': (20., 2.), 'S6': (22., 2.), '7': (24., 2.), '13': (24., 0.), 11 | 'C': (24., 4.), 'S7': (26., 2.), '8': (28., 2.), 'S8': (30., 2.), 12 | '9': (32., 2.), '14': (32., 0.)} 13 | 14 | F.G.print_graph(initial_pos=initial, size=200, arrow_size=4, fsize=10, 15 | fixed_nodes=list(F.G), title='Switch line (integer)', 16 | legend_loc='upper center', legend_ncol=8, legend_anchor=(0.5, 1.05), 17 | legend_fsize=7) 18 | 19 | F.simulate_element_perturbation(["1"]) 20 | print("\nPredecessors of S1: ", list(F.G.predecessors('S1'))) 21 | print("\nSuccessors of S1: ", list(F.G.successors('S1'))) 22 | 23 | F.G.print_graph(initial_pos=initial, size=200, arrow_size=4, fsize=10, 24 | fixed_nodes=list(F.G), title='Switch line (node 1 perturbed)', 25 | legend_loc='upper center', legend_ncol=8, 26 | legend_anchor=(0.5, 1.05), legend_fsize=7) 27 | 28 | D = FaultDiagnosis("./input_files/switch_line.csv") 29 | D.simulate_element_perturbation(["2"]) 30 | 31 | D.G.print_graph(initial_pos=initial, size=200, arrow_size=4, fsize=10, 32 | fixed_nodes=list(D.G), title='Switch line (node 2 perturbed)', 33 | legend_loc='upper center', legend_ncol=8, 34 | legend_anchor=(0.5, 1.05), legend_fsize=7) 35 | 36 | T = FaultDiagnosis("./input_files/switch_line.csv") 37 | T.simulate_element_perturbation(["2", "3"]) 38 | 39 | T.G.print_graph(initial_pos=initial, size=200, arrow_size=4, fsize=10, 40 | fixed_nodes=list(T.G), title='Switch line (nodes 2 and 3 perturbed)', 41 | legend_loc='upper center', legend_ncol=8, 42 | legend_anchor=(0.5, 1.05), legend_fsize=7) 43 | -------------------------------------------------------------------------------- /docs/source/parallel_general_graph.rst: -------------------------------------------------------------------------------- 1 | ParallelGeneralGraph 2 | ===================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. automodule:: grape.parallel_general_graph 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | ParallelGeneralGraph 13 | ParallelGeneralGraph.measure_iteration 14 | ParallelGeneralGraph.measure_processes 15 | ParallelGeneralGraph.floyd_warshall_predecessor_and_distance 16 | ParallelGeneralGraph.dijkstra_iteration_parallel 17 | ParallelGeneralGraph.dijkstra_single_source_shortest_path 18 | ParallelGeneralGraph.calculate_shortest_path 19 | ParallelGeneralGraph.compute_efficiency 20 | ParallelGeneralGraph.compute_nodal_efficiency 21 | ParallelGeneralGraph.compute_local_efficiency 22 | ParallelGeneralGraph.shortest_path_list_iteration 23 | ParallelGeneralGraph.compute_betweenness_centrality 24 | ParallelGeneralGraph.compute_closeness_centrality 25 | ParallelGeneralGraph.compute_degree_centrality 26 | ParallelGeneralGraph.compute_indegree_centrality 27 | ParallelGeneralGraph.compute_outdegree_centrality 28 | 29 | .. autoclass:: ParallelGeneralGraph 30 | :members: 31 | :inherited-members: load, mark, area, perturbation_resistant, description, 32 | init_status, final_status, mark_status, status_area, father_condition, 33 | weight, type, sources, users, switches, initial_service, service, 34 | shortest_path, shortest_path_length, efficiency, nodal_efficiency, 35 | local_efficiency, global_efficiency, betweenness_centrality, 36 | closeness_centrality, degree_centrality, indegree_centrality, 37 | outdegree_centrality, clear_data, construct_path_kernel, 38 | floyd_warshall_initialization, floyd_warshall_kernel, 39 | efficiency_kernel, nodal_efficiency_kernel, local_efficiency_kernel, 40 | shortest_path_list_kernel, betweenness_centrality_kernel, 41 | closeness_centrality_kernel, degree_centrality_kernel, 42 | indegree_centrality_kernel, outdegree_centrality_kernel, compute_service 43 | :private-members: 44 | :undoc-members: 45 | :show-inheritance: GeneralGraph 46 | :noindex: 47 | -------------------------------------------------------------------------------- /docs/source/general_code_output.log: -------------------------------------------------------------------------------- 1 | DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): docs.scipy.org:80 2 | DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): docs.python.org:80 3 | DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): docs.scipy.org:80 4 | DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): matplotlib.sourceforge.net:80 5 | DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): networkx.github.io:443 6 | DEBUG:urllib3.connectionpool:http://docs.python.org:80 "GET /2/objects.inv HTTP/1.1" 301 0 7 | DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): docs.python.org:443 8 | DEBUG:urllib3.connectionpool:http://docs.scipy.org:80 "GET /doc/scipy/reference/objects.inv HTTP/1.1" 301 342 9 | DEBUG:urllib3.connectionpool:http://docs.scipy.org:80 "GET /doc/numpy/objects.inv HTTP/1.1" 301 332 10 | DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): docs.scipy.org:443 11 | DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): docs.scipy.org:443 12 | DEBUG:urllib3.connectionpool:https://networkx.github.io:443 "GET /documentation/stable/objects.inv HTTP/1.1" 301 162 13 | DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): networkx.org:443 14 | DEBUG:urllib3.connectionpool:http://matplotlib.sourceforge.net:80 "GET /objects.inv HTTP/1.1" 301 241 15 | DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): matplotlib.org:80 16 | DEBUG:urllib3.connectionpool:https://docs.python.org:443 "GET /2/objects.inv HTTP/1.1" 200 85381 17 | DEBUG:urllib3.connectionpool:http://matplotlib.org:80 "GET /objects.inv HTTP/1.1" 301 None 18 | DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): matplotlib.org:443 19 | DEBUG:urllib3.connectionpool:https://docs.scipy.org:443 "GET /doc/scipy/reference/objects.inv HTTP/1.1" 200 81641 20 | DEBUG:urllib3.connectionpool:https://docs.scipy.org:443 "GET /doc/numpy/objects.inv HTTP/1.1" 301 329 21 | DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): numpy.org:443 22 | DEBUG:urllib3.connectionpool:https://matplotlib.org:443 "GET /objects.inv HTTP/1.1" 200 98623 23 | DEBUG:urllib3.connectionpool:https://networkx.org:443 "GET /documentation/stable/objects.inv HTTP/1.1" 200 36576 24 | DEBUG:urllib3.connectionpool:https://numpy.org:443 "GET /doc/stable/objects.inv HTTP/1.1" 200 62911 25 | -------------------------------------------------------------------------------- /docs/make_rst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################################################################ 3 | ## Bash file for the automatic creation of .RST file ## 4 | ## ## 5 | ## This script does not work on modules that not contains class definition ## 6 | ################################################################################ 7 | 8 | module='grape' 9 | 10 | files=`ls ../$module/[a-z]*.py` 11 | 12 | for f in $files; do 13 | 14 | filename=$(basename $f .py) 15 | 16 | classname=`grep "class.*(.*):$" $f | awk '{print $2}' | cut -d"(" -f 1` 17 | [[ -z $classname ]] && echo "WARNING: class not found in file $f" 18 | 19 | methodnames=`grep -e 'def .*(.*):$' $f | awk '{print $2}' | cut -d "(" -f 1` 20 | [[ -z $classname ]] && echo "WARNING: methods not found in file $f" 21 | 22 | methodnames=`sed -r 's/\b(__init__|__new__)\b//g' <<< $methodnames` 23 | 24 | output="source/$filename.rst" 25 | 26 | echo -e "$classname" > $output 27 | echo -e "=====================" >> $output 28 | echo -e "" >> $output 29 | echo -e ".. currentmodule:: $module.$filename" >> $output 30 | echo -e "" >> $output 31 | echo -e ".. automodule:: $module.$filename" >> $output 32 | echo -e "" >> $output 33 | echo -e ".. autosummary::" >> $output 34 | echo -e " :toctree: _summaries" >> $output 35 | echo -e " :nosignatures:" >> $output 36 | echo -e "" >> $output 37 | echo -e " $classname" >> $output 38 | for methodname in $methodnames; do 39 | echo -e " $classname.$methodname" >> $output 40 | done 41 | echo -e "" >> $output 42 | echo -e ".. autoclass:: $classname" >> $output 43 | echo -e " :members:" >> $output 44 | echo -e " :private-members:" >> $output 45 | echo -e " :undoc-members:" >> $output 46 | echo -e " :show-inheritance:" >> $output 47 | echo -e " :noindex:" >> $output 48 | 49 | cat $output 50 | done 51 | -------------------------------------------------------------------------------- /docs/source/general_graph.rst: -------------------------------------------------------------------------------- 1 | GeneralGraph 2 | ===================== 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. automodule:: grape.general_graph 7 | 8 | .. autosummary:: 9 | :toctree: _summaries 10 | :nosignatures: 11 | 12 | GeneralGraph 13 | GeneralGraph.load 14 | GeneralGraph.mark 15 | GeneralGraph.area 16 | GeneralGraph.perturbation_resistant 17 | GeneralGraph.description 18 | GeneralGraph.init_status 19 | GeneralGraph.final_status 20 | GeneralGraph.mark_status 21 | GeneralGraph.status_area 22 | GeneralGraph.father_condition 23 | GeneralGraph.weight 24 | GeneralGraph.type 25 | GeneralGraph.sources 26 | GeneralGraph.users 27 | GeneralGraph.switches 28 | GeneralGraph.initial_service 29 | GeneralGraph.service 30 | GeneralGraph.shortest_path 31 | GeneralGraph.shortest_path_length 32 | GeneralGraph.efficiency 33 | GeneralGraph.nodal_efficiency 34 | GeneralGraph.local_efficiency 35 | GeneralGraph.global_efficiency 36 | GeneralGraph.betweenness_centrality 37 | GeneralGraph.closeness_centrality 38 | GeneralGraph.degree_centrality 39 | GeneralGraph.indegree_centrality 40 | GeneralGraph.outdegree_centrality 41 | GeneralGraph.clear_data 42 | GeneralGraph.construct_path_kernel 43 | GeneralGraph.floyd_warshall_initialization 44 | GeneralGraph.floyd_warshall_kernel 45 | GeneralGraph.floyd_warshall_predecessor_and_distance 46 | GeneralGraph.dijkstra_single_source_shortest_path 47 | GeneralGraph.calculate_shortest_path 48 | GeneralGraph.efficiency_kernel 49 | GeneralGraph.compute_efficiency 50 | GeneralGraph.nodal_efficiency_kernel 51 | GeneralGraph.compute_nodal_efficiency 52 | GeneralGraph.local_efficiency_kernel 53 | GeneralGraph.compute_local_efficiency 54 | GeneralGraph.shortest_path_list_kernel 55 | GeneralGraph.betweenness_centrality_kernel 56 | GeneralGraph.compute_betweenness_centrality 57 | GeneralGraph.closeness_centrality_kernel 58 | GeneralGraph.compute_closeness_centrality 59 | GeneralGraph.degree_centrality_kernel 60 | GeneralGraph.compute_degree_centrality 61 | GeneralGraph.indegree_centrality_kernel 62 | GeneralGraph.compute_indegree_centrality 63 | GeneralGraph.outdegree_centrality_kernel 64 | GeneralGraph.compute_outdegree_centrality 65 | GeneralGraph.compute_service 66 | 67 | .. autoclass:: GeneralGraph 68 | :members: 69 | :private-members: 70 | :undoc-members: 71 | :show-inheritance: 72 | :noindex: 73 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to GRAPE's documentation! 2 | =================================================== 3 | 4 | GRAph Parallel Environment 5 | 6 | Description 7 | -------------------- 8 | GRAPE (GRAph Parallel Environment) is a Python package that takes advantage of 9 | Graph Theory into a High Performance Computing (HPC) environment to develope a 10 | screening tool aimed at studying the effect of different kinds of perturbations 11 | in interconnected systems, such as indsutrial plants. 12 | 13 | The tool allows to represent the dependencies between components and predict 14 | the state of health and the residual functionality of degradable systems after 15 | a casualty, suggesting the proper reconfiguration strategies to mitigate the 16 | damage. The results obtained from the graph analysis can be therefore used to 17 | improve topology, robustness, and resilience profile of industrial facilities 18 | against domino effect propagation. 19 | 20 | In particular, the components contribution to the cascade effects resulting 21 | from adverse events can be evaluated through centrality and efficiency 22 | measures, highlighting the plants major criticalities, vulnerabilities and 23 | potential weak points. 24 | 25 | Considering that the most computationally expensive parts of the program 26 | involve the calculation of shortest paths, parallelization of shortest path 27 | computation in large unweighted graphs was integrated in the program. This was 28 | done taking advantage of the Python modules multiprocessing and threading. Two 29 | different sequential algorithms for the solution of the shortest path problem 30 | have been parallelized including a Single Source Shortest Path (SSSP) algorythm 31 | for sparse graphs and an All Pairs Shortest Path one (APSP) for dense graphs. 32 | 33 | 34 | Installation 35 | -------------------- 36 | The official distribution is on GitHub, and you can clone the repository using 37 | :: 38 | 39 | git clone https://github.com/mathLab/GRAPE 40 | 41 | To install the package just type: 42 | :: 43 | 44 | python setup.py install 45 | 46 | To uninstall the package you have to rerun the installation and record the installed files in order to remove them: 47 | 48 | :: 49 | 50 | python setup.py install --record installed_files.txt 51 | cat installed_files.txt | xargs rm -rf 52 | 53 | 54 | Developer's Guide 55 | -------------------- 56 | 57 | .. toctree:: 58 | :maxdepth: 1 59 | 60 | code 61 | contact 62 | contributing 63 | LICENSE 64 | 65 | 66 | Indices and tables 67 | -------------------- 68 | 69 | * :ref:`genindex` 70 | * :ref:`modindex` 71 | * :ref:`search` 72 | 73 | -------------------------------------------------------------------------------- /tutorials/tutorial02/output_files/element_perturbation.csv: -------------------------------------------------------------------------------- 1 | mark,description,init_status,final_status,mark_status,original_closeness_centrality,final_closeness_centrality,original_betweenness_centrality,final_betweenness_centrality,original_indegree_centrality,final_indegree_centrality,original_outdegree_centrality,final_outdegree_centrality,original_local_efficiency,final_local_efficiency,original_nodal_efficiency,final_nodal_efficiency,original_service,final_service 2 | 1,,,,,0.0,,0.0,,0.0,,0.1111111111111111,,0.17437369729036395,,0.3213624338624339,,0.0, 3 | 2,,1,1,,0.05555555555555555,,0.05161290322580645,,0.05555555555555555,,0.05555555555555555,,0.20222663139329808,,0.19689554272887605,,0.0, 4 | 3,,1,0,ACTIVE,0.05555555555555555,0.0,0.04516129032258064,0.0,0.05555555555555555,0.0,0.05555555555555555,0.5,0.14814814814814814,0.0,0.15185185185185185,0.5,0.0,0.0 5 | 4,,,,,0.07407407407407407,,0.12903225806451613,,0.05555555555555555,,0.05555555555555555,,0.22583774250440916,,0.20222663139329808,,0.0, 6 | 5,,,,ACTIVE,0.07407407407407407,0.5,0.07741935483870968,0.0,0.05555555555555555,0.5,0.05555555555555555,0.0,0.14814814814814817,0.0,0.14814814814814814,0.0,0.0,0.0 7 | 6,,,,,0.1736111111111111,,0.2709677419354839,,0.16666666666666666,,0.1111111111111111,,0.21182760141093476,,0.22583774250440916,,0.0, 8 | 7,,,,,0.11574074074074076,,0.0,,0.05555555555555555,,0.05555555555555555,,0.22583774250440916,,0.1744488536155203,,0.0, 9 | 8,,,,,0.11574074074074076,,0.2838709677419355,,0.05555555555555555,,0.1111111111111111,,0.1935405643738977,,0.24920634920634926,,0.0, 10 | 9,,,,,0.14327485380116958,,0.36774193548387096,,0.1111111111111111,,0.05555555555555555,,0.15648148148148147,,0.16124338624338622,,0.0, 11 | 15,,,,ACTIVE,0.0,0.0,0.0,0.0,0.0,0.0,0.05555555555555555,0.0,0.16124338624338622,0.0,0.16587301587301584,0.0,0.0,0.0 12 | 16,,,,,0.16071428571428573,,0.3741935483870968,,0.1111111111111111,,0.05555555555555555,,0.20740740740740743,,0.15648148148148147,,0.0, 13 | 17,,,,,0.125,,0.36774193548387096,,0.05555555555555555,,0.1111111111111111,,0.1523148148148148,,0.20740740740740743,,0.0, 14 | 10,,,,,0.12077294685990338,,0.34838709677419355,,0.05555555555555555,,0.05555555555555555,,0.14814814814814817,,0.14814814814814814,,0.0, 15 | 11,,,,,0.17386831275720163,,0.41935483870967744,,0.1111111111111111,,0.05555555555555555,,0.16666666666666666,,0.14814814814814817,,0.0, 16 | 19,,,,,0.22299382716049382,,0.38064516129032255,,0.16666666666666666,,0.1111111111111111,,0.17592592592592593,,0.16666666666666666,,0.0, 17 | 12,,,,,0.1866925064599483,,0.1032258064516129,,0.1111111111111111,,0.1111111111111111,,0.16666666666666666,,0.1574074074074074,,0.0, 18 | 13,,,,,0.16055555555555556,,0.0,,0.1111111111111111,,0.1111111111111111,,0.17592592592592593,,0.16666666666666666,,0.0, 19 | 14,,,,,0.1866925064599483,,0.10967741935483871,,0.1111111111111111,,0.16666666666666666,,0.1111111111111111,,0.19444444444444445,,0.0, 20 | 18,,,,,0.17307692307692307,,0.0,,0.05555555555555555,,0.0,,0.0,,0.0,,3.0, 21 | -------------------------------------------------------------------------------- /tutorials/tutorial03/output_files/service_paths_element_perturbation.csv: -------------------------------------------------------------------------------- 1 | from,to,original_shortest_path_length,original_shortest_path,original_simple_path,original_pair_efficiency,ids,final_shortest_path_length,final_shortest_path,final_simple_path,final_pair_efficiency 2 | A,10,2.0,"['A', '1', '10']","[['A', '1', '10']]",0.5,A10,2.0,"['A', '1', '10']","[['A', '1', '10']]",0.5 3 | A,11,6.0,"['A', '1', 'S1', '2', 'S2', '3', '11']","[['A', '1', 'S1', '2', 'S2', '3', '11']]",0.16666666666666666,A11,,,, 4 | A,12,10.0,"['A', '1', 'S1', '2', 'S2', '3', 'S3', '4', 'S4', '5', '12']","[['A', '1', 'S1', '2', 'S2', '3', 'S3', '4', 'S4', '5', '12']]",0.1,A12,NO_PATH,NO_PATH,NO_PATH,NO_PATH 5 | A,13,14.0,"['A', '1', 'S1', '2', 'S2', '3', 'S3', '4', 'S4', '5', 'S5', '6', 'S6', '7', '13']","[['A', '1', 'S1', '2', 'S2', '3', 'S3', '4', 'S4', '5', 'S5', '6', 'S6', '7', '13']]",0.07142857142857142,A13,NO_PATH,NO_PATH,NO_PATH,NO_PATH 6 | A,14,18.0,"['A', '1', 'S1', '2', 'S2', '3', 'S3', '4', 'S4', '5', 'S5', '6', 'S6', '7', 'S7', '8', 'S8', '9', '14']","[['A', '1', 'S1', '2', 'S2', '3', 'S3', '4', 'S4', '5', 'S5', '6', 'S6', '7', 'S7', '8', 'S8', '9', '14']]",0.05555555555555555,A14,NO_PATH,NO_PATH,NO_PATH,NO_PATH 7 | B,10,10.0,"['B', '5', 'S4', '4', 'S3', '3', 'S2', '2', 'S1', '1', '10']","[['B', '5', 'S4', '4', 'S3', '3', 'S2', '2', 'S1', '1', '10']]",0.1,B10,NO_PATH,NO_PATH,NO_PATH,NO_PATH 8 | B,11,6.0,"['B', '5', 'S4', '4', 'S3', '3', '11']","[['B', '5', 'S4', '4', 'S3', '3', '11']]",0.16666666666666666,B11,,,, 9 | B,12,2.0,"['B', '5', '12']","[['B', '5', '12']]",0.5,B12,2.0,"['B', '5', '12']","[['B', '5', '12']]",0.5 10 | B,13,6.0,"['B', '5', 'S5', '6', 'S6', '7', '13']","[['B', '5', 'S5', '6', 'S6', '7', '13']]",0.16666666666666666,B13,6.0,"['B', '5', 'S5', '6', 'S6', '7', '13']","[['B', '5', 'S5', '6', 'S6', '7', '13']]",0.16666666666666666 11 | B,14,10.0,"['B', '5', 'S5', '6', 'S6', '7', 'S7', '8', 'S8', '9', '14']","[['B', '5', 'S5', '6', 'S6', '7', 'S7', '8', 'S8', '9', '14']]",0.1,B14,10.0,"['B', '5', 'S5', '6', 'S6', '7', 'S7', '8', 'S8', '9', '14']","[['B', '5', 'S5', '6', 'S6', '7', 'S7', '8', 'S8', '9', '14']]",0.1 12 | C,10,14.0,"['C', '7', 'S6', '6', 'S5', '5', 'S4', '4', 'S3', '3', 'S2', '2', 'S1', '1', '10']","[['C', '7', 'S6', '6', 'S5', '5', 'S4', '4', 'S3', '3', 'S2', '2', 'S1', '1', '10']]",0.07142857142857142,C10,NO_PATH,NO_PATH,NO_PATH,NO_PATH 13 | C,11,10.0,"['C', '7', 'S6', '6', 'S5', '5', 'S4', '4', 'S3', '3', '11']","[['C', '7', 'S6', '6', 'S5', '5', 'S4', '4', 'S3', '3', '11']]",0.1,C11,,,, 14 | C,12,6.0,"['C', '7', 'S6', '6', 'S5', '5', '12']","[['C', '7', 'S6', '6', 'S5', '5', '12']]",0.16666666666666666,C12,6.0,"['C', '7', 'S6', '6', 'S5', '5', '12']","[['C', '7', 'S6', '6', 'S5', '5', '12']]",0.16666666666666666 15 | C,13,2.0,"['C', '7', '13']","[['C', '7', '13']]",0.5,C13,2.0,"['C', '7', '13']","[['C', '7', '13']]",0.5 16 | C,14,6.0,"['C', '7', 'S7', '8', 'S8', '9', '14']","[['C', '7', 'S7', '8', 'S8', '9', '14']]",0.16666666666666666,C14,6.0,"['C', '7', 'S7', '8', 'S8', '9', '14']","[['C', '7', 'S7', '8', 'S8', '9', '14']]",0.16666666666666666 17 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | meta = {} 4 | with open("grape/meta.py") as fp: 5 | exec(fp.read(), meta) 6 | 7 | # Package meta-data. 8 | IMPORTNAME = meta['__title__'] 9 | PIPNAME = meta['__packagename__'] 10 | NAME = meta['__title__'] 11 | DESCRIPTION = 'GRAph Parallel Environment.' 12 | URL = 'https://github.com/mathLab/GRAPE' 13 | MAIL = meta['__mail__'] 14 | AUTHOR = meta['__author__'] 15 | VERSION = meta['__version__'] 16 | KEYWORDS = ( 17 | 'risk-analysis graph-theory parallel-programming shortest-path ' 18 | 'system-analysis fault-diagnostics' 19 | ) 20 | 21 | REQUIRED = [ 22 | 'networkx', 'numpy', 'scipy', 'matplotlib', 'pandas', 'deap', 23 | ] 24 | 25 | EXTRAS = { 26 | 'docs': ['sphinx', 'sphinx_rtd_theme'], 27 | 'test': ['pytest', 'pytest-cov'], 28 | } 29 | 30 | LDESCRIPTION = ( 31 | "GRAPE is a Python package that takes advantage of Graph Theory " 32 | "into a High Performance Computing (HPC) environment to develop a " 33 | "screening tool aimed at studying the effect of different kinds of " 34 | "perturbations in interconnected systems, such as indsutrial plants." 35 | "\n" 36 | "The tool allows to represent the dependencies between components and " 37 | "predict the state of health and the residual functionality of degradable " 38 | "systems after a damage, suggesting the proper reconfiguration strategies " 39 | "to mitigate it. The results obtained from the graph analysis can be " 40 | "therefore used to improve topology, robustness, and resilience profile " 41 | "of industrial facilities against domino effect propagation." 42 | "In particular, the components contribution to the cascade effects " 43 | "resulting from adverse events can be evaluated through centrality and " 44 | "efficiency measures, highlighting the plants major criticalities, " 45 | "vulnerabilities and potential weak points." 46 | "\n" 47 | "Considering that the most computationally expensive parts of the program " 48 | "involve the calculation of shortest paths, parallelization of shortest " 49 | "path computation in large unweighted graphs was integrated in the " 50 | "program. This was done taking advantage of the Python module " 51 | "multiprocessing. Two different sequential algorithms for the solution of " 52 | "the shortest path problem have been parallelized including a Single " 53 | "Source Shortest Path (SSSP) algorythm for sparse graphs and an All Pairs " 54 | "Shortest Path one (APSP) for dense graphs.\n" 55 | ) 56 | 57 | setup( 58 | name=PIPNAME, 59 | version=VERSION, 60 | description=DESCRIPTION, 61 | long_description=LDESCRIPTION, 62 | author=AUTHOR, 63 | author_email=MAIL, 64 | classifiers=[ 65 | 'Development Status :: 5 - Production/Stable', 66 | 'License :: OSI Approved :: MIT License', 67 | 'Programming Language :: Python :: 3.6', 68 | 'Intended Audience :: Science/Research', 69 | 'Topic :: Scientific/Engineering :: Mathematics' 70 | ], 71 | keywords=KEYWORDS, 72 | url=URL, 73 | license='MIT', 74 | packages=find_packages(), 75 | install_requires=REQUIRED, 76 | extras_require=EXTRAS, 77 | include_package_data=True, 78 | zip_safe=False 79 | ) 80 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.general_graph.GeneralGraph.rst: -------------------------------------------------------------------------------- 1 | grape.general\_graph.GeneralGraph 2 | ================================= 3 | 4 | .. currentmodule:: grape.general_graph 5 | 6 | .. autoclass:: GeneralGraph 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~GeneralGraph.__init__ 17 | ~GeneralGraph.add_edge 18 | ~GeneralGraph.add_edges_from 19 | ~GeneralGraph.add_node 20 | ~GeneralGraph.add_nodes_from 21 | ~GeneralGraph.add_weighted_edges_from 22 | ~GeneralGraph.adjacency 23 | ~GeneralGraph.betweenness_centrality_kernel 24 | ~GeneralGraph.calculate_shortest_path 25 | ~GeneralGraph.clear 26 | ~GeneralGraph.clear_data 27 | ~GeneralGraph.clear_edges 28 | ~GeneralGraph.closeness_centrality_kernel 29 | ~GeneralGraph.compute_betweenness_centrality 30 | ~GeneralGraph.compute_closeness_centrality 31 | ~GeneralGraph.compute_degree_centrality 32 | ~GeneralGraph.compute_efficiency 33 | ~GeneralGraph.compute_indegree_centrality 34 | ~GeneralGraph.compute_local_efficiency 35 | ~GeneralGraph.compute_nodal_efficiency 36 | ~GeneralGraph.compute_outdegree_centrality 37 | ~GeneralGraph.compute_service 38 | ~GeneralGraph.construct_path_kernel 39 | ~GeneralGraph.copy 40 | ~GeneralGraph.degree_centrality_kernel 41 | ~GeneralGraph.dijkstra_single_source_shortest_path 42 | ~GeneralGraph.edge_subgraph 43 | ~GeneralGraph.efficiency_kernel 44 | ~GeneralGraph.floyd_warshall_initialization 45 | ~GeneralGraph.floyd_warshall_kernel 46 | ~GeneralGraph.floyd_warshall_predecessor_and_distance 47 | ~GeneralGraph.get_edge_data 48 | ~GeneralGraph.has_edge 49 | ~GeneralGraph.has_node 50 | ~GeneralGraph.has_predecessor 51 | ~GeneralGraph.has_successor 52 | ~GeneralGraph.indegree_centrality_kernel 53 | ~GeneralGraph.is_directed 54 | ~GeneralGraph.is_multigraph 55 | ~GeneralGraph.load 56 | ~GeneralGraph.local_efficiency_kernel 57 | ~GeneralGraph.nbunch_iter 58 | ~GeneralGraph.neighbors 59 | ~GeneralGraph.nodal_efficiency_kernel 60 | ~GeneralGraph.number_of_edges 61 | ~GeneralGraph.number_of_nodes 62 | ~GeneralGraph.order 63 | ~GeneralGraph.outdegree_centrality_kernel 64 | ~GeneralGraph.predecessors 65 | ~GeneralGraph.remove_edge 66 | ~GeneralGraph.remove_edges_from 67 | ~GeneralGraph.remove_node 68 | ~GeneralGraph.remove_nodes_from 69 | ~GeneralGraph.reverse 70 | ~GeneralGraph.shortest_path_list_kernel 71 | ~GeneralGraph.size 72 | ~GeneralGraph.subgraph 73 | ~GeneralGraph.successors 74 | ~GeneralGraph.to_directed 75 | ~GeneralGraph.to_directed_class 76 | ~GeneralGraph.to_undirected 77 | ~GeneralGraph.to_undirected_class 78 | ~GeneralGraph.update 79 | 80 | 81 | 82 | 83 | 84 | .. rubric:: Attributes 85 | 86 | .. autosummary:: 87 | 88 | ~GeneralGraph.adj 89 | ~GeneralGraph.area 90 | ~GeneralGraph.betweenness_centrality 91 | ~GeneralGraph.closeness_centrality 92 | ~GeneralGraph.degree 93 | ~GeneralGraph.degree_centrality 94 | ~GeneralGraph.description 95 | ~GeneralGraph.edges 96 | ~GeneralGraph.efficiency 97 | ~GeneralGraph.father_condition 98 | ~GeneralGraph.final_status 99 | ~GeneralGraph.global_efficiency 100 | ~GeneralGraph.in_degree 101 | ~GeneralGraph.in_edges 102 | ~GeneralGraph.indegree_centrality 103 | ~GeneralGraph.init_status 104 | ~GeneralGraph.initial_service 105 | ~GeneralGraph.local_efficiency 106 | ~GeneralGraph.mark 107 | ~GeneralGraph.mark_status 108 | ~GeneralGraph.name 109 | ~GeneralGraph.nodal_efficiency 110 | ~GeneralGraph.nodes 111 | ~GeneralGraph.out_degree 112 | ~GeneralGraph.out_edges 113 | ~GeneralGraph.outdegree_centrality 114 | ~GeneralGraph.perturbation_resistant 115 | ~GeneralGraph.pred 116 | ~GeneralGraph.service 117 | ~GeneralGraph.shortest_path 118 | ~GeneralGraph.shortest_path_length 119 | ~GeneralGraph.sources 120 | ~GeneralGraph.status_area 121 | ~GeneralGraph.succ 122 | ~GeneralGraph.switches 123 | ~GeneralGraph.type 124 | ~GeneralGraph.users 125 | ~GeneralGraph.weight 126 | 127 | -------------------------------------------------------------------------------- /tutorials/tutorial01/output_files/element_perturbation.csv: -------------------------------------------------------------------------------- 1 | mark,description,init_status,final_status,mark_status,original_closeness_centrality,final_closeness_centrality,original_betweenness_centrality,final_betweenness_centrality,original_indegree_centrality,final_indegree_centrality,original_outdegree_centrality,final_outdegree_centrality,original_local_efficiency,final_local_efficiency,original_nodal_efficiency,final_nodal_efficiency,original_service,final_service 2 | 1,,,,,0.0,,0.0,,0.0,,0.1111111111111111,,0.17437369729036395,,0.3213624338624339,,0.0, 3 | 2,,1,0,ACTIVE,0.05555555555555555,0.0,0.05161290322580645,0.0,0.05555555555555555,0.0,0.05555555555555555,0.058823529411764705,0.20222663139329808,0.21412231559290384,0.19689554272887605,0.20847763347763348,0.0,0.0 4 | 3,,1,0,ACTIVE,0.05555555555555555,0.0,0.04516129032258064,0.0,0.05555555555555555,0.0,0.05555555555555555,0.058823529411764705,0.14814814814814814,0.1568627450980392,0.15185185185185185,0.1607843137254902,0.0,0.0 5 | 4,,,,ACTIVE,0.07407407407407407,0.058823529411764705,0.12903225806451613,0.09420289855072464,0.05555555555555555,0.058823529411764705,0.05555555555555555,0.058823529411764705,0.22583774250440916,0.2391223155929038,0.20222663139329808,0.21412231559290384,0.0,0.0 6 | 5,,,,ACTIVE,0.07407407407407407,0.058823529411764705,0.07741935483870968,0.043478260869565216,0.05555555555555555,0.058823529411764705,0.05555555555555555,0.058823529411764705,0.14814814814814817,0.15686274509803924,0.14814814814814814,0.1568627450980392,0.0,0.0 7 | 6,,,,ACTIVE,0.1736111111111111,0.18823529411764706,0.2709677419354839,0.2608695652173913,0.16666666666666666,0.17647058823529413,0.1111111111111111,0.11764705882352941,0.21182760141093476,0.22428804855275447,0.22583774250440916,0.2391223155929038,0.0,0.0 8 | 7,,,,ACTIVE,0.11574074074074076,0.11764705882352941,0.0,0.0,0.05555555555555555,0.058823529411764705,0.05555555555555555,0.058823529411764705,0.22583774250440916,0.2391223155929038,0.1744488536155203,0.18471055088702149,0.0,0.0 9 | 8,,,,ACTIVE,0.11574074074074076,0.11764705882352941,0.2838709677419355,0.2898550724637681,0.05555555555555555,0.058823529411764705,0.1111111111111111,0.11764705882352941,0.1935405643738977,0.2049253034547152,0.24920634920634926,0.26386554621848746,0.0,0.0 10 | 9,,,,ACTIVE,0.14327485380116958,0.15126050420168066,0.36774193548387096,0.391304347826087,0.1111111111111111,0.11764705882352941,0.05555555555555555,0.058823529411764705,0.15648148148148147,0.16568627450980392,0.16124338624338622,0.1707282913165266,0.0,0.0 11 | 15,,,,ACTIVE,0.0,0.0,0.0,0.0,0.0,0.0,0.05555555555555555,0.058823529411764705,0.16124338624338622,0.1707282913165266,0.16587301587301584,0.17563025210084032,0.0,0.0 12 | 16,,,,ACTIVE,0.16071428571428573,0.1711229946524064,0.3741935483870968,0.4057971014492754,0.1111111111111111,0.11764705882352941,0.05555555555555555,0.058823529411764705,0.20740740740740743,0.21960784313725493,0.15648148148148147,0.16568627450980392,0.0,0.0 13 | 17,,,,ACTIVE,0.125,0.12981744421906694,0.36774193548387096,0.4057971014492754,0.05555555555555555,0.058823529411764705,0.1111111111111111,0.11764705882352941,0.1523148148148148,0.16127450980392155,0.20740740740740743,0.21960784313725493,0.0,0.0 14 | 10,,,,ACTIVE,0.12077294685990338,0.12538699690402477,0.34838709677419355,0.391304347826087,0.05555555555555555,0.058823529411764705,0.05555555555555555,0.058823529411764705,0.14814814814814817,0.15686274509803924,0.14814814814814814,0.1568627450980392,0.0,0.0 15 | 11,,,,ACTIVE,0.17386831275720163,0.1660899653979239,0.41935483870967744,0.43478260869565216,0.1111111111111111,0.11764705882352941,0.05555555555555555,0.058823529411764705,0.16666666666666666,0.17647058823529413,0.14814814814814817,0.15686274509803924,0.0,0.0 16 | 19,,,,ACTIVE,0.22299382716049382,0.22145328719723184,0.38064516129032255,0.39855072463768115,0.16666666666666666,0.17647058823529413,0.1111111111111111,0.11764705882352941,0.17592592592592593,0.18627450980392157,0.16666666666666666,0.17647058823529413,0.0,0.0 17 | 12,,,,ACTIVE,0.1866925064599483,0.1859114015976761,0.1032258064516129,0.10869565217391304,0.1111111111111111,0.11764705882352941,0.1111111111111111,0.11764705882352941,0.16666666666666666,0.17647058823529413,0.1574074074074074,0.16666666666666669,0.0,0.0 18 | 13,,,,ACTIVE,0.16055555555555556,0.16020025031289112,0.0,0.0,0.1111111111111111,0.11764705882352941,0.1111111111111111,0.11764705882352941,0.17592592592592593,0.18627450980392157,0.16666666666666666,0.17647058823529413,0.0,0.0 19 | 14,,,,ACTIVE,0.1866925064599483,0.1859114015976761,0.10967741935483871,0.11594202898550725,0.1111111111111111,0.11764705882352941,0.16666666666666666,0.17647058823529413,0.1111111111111111,0.11764705882352942,0.19444444444444445,0.20588235294117646,0.0,0.0 20 | 18,,,,ACTIVE,0.17307692307692307,0.17346938775510204,0.0,0.0,0.05555555555555555,0.058823529411764705,0.0,0.0,0.0,0.0,0.0,0.0,3.0,2.0 21 | -------------------------------------------------------------------------------- /tutorials/tutorial03/output_files/element_perturbation.csv: -------------------------------------------------------------------------------- 1 | mark,description,init_status,final_status,mark_status,original_closeness_centrality,final_closeness_centrality,original_betweenness_centrality,final_betweenness_centrality,original_indegree_centrality,final_indegree_centrality,original_outdegree_centrality,final_outdegree_centrality,original_local_efficiency,final_local_efficiency,original_nodal_efficiency,final_nodal_efficiency,original_service,final_service 2 | 10,,,,ACTIVE,0.0931098696461825,0.09,0.0,0.0,0.041666666666666664,0.05,0.0,0.0,0.0,0.0,0.0,0.0,0.6000000000000001,1.0 3 | 11,,,,,0.13123359580052493,,0.0,,0.041666666666666664,,0.0,,0.0,,0.0,,0.6000000000000001, 4 | 12,,,,ACTIVE,0.1557632398753894,0.15806451612903225,0.0,0.0,0.041666666666666664,0.05,0.0,0.0,0.0,0.0,0.0,0.0,0.6000000000000001,0.6666666666666666 5 | 13,,,,ACTIVE,0.13123359580052493,0.16896551724137931,0.0,0.0,0.041666666666666664,0.05,0.0,0.0,0.0,0.0,0.0,0.0,0.6000000000000001,0.6666666666666666 6 | 14,,,,ACTIVE,0.08912655971479501,0.10425531914893615,0.0,0.0,0.041666666666666664,0.05,0.0,0.0,0.0,0.0,0.0,0.0,0.6000000000000001,0.6666666666666666 7 | 1,,,,ACTIVE,0.09460167714884696,0.1,0.09219858156028368,0.010526315789473684,0.08333333333333333,0.1,0.08333333333333333,0.05,0.11123046513671513,0.0,0.2011494462781227,0.05,0.0,0.0 8 | S1,,1,0,ACTIVE,0.10518648018648018,0.0,0.1702127659574468,0.0,0.08333333333333333,0.0,0.08333333333333333,0.05,0.21971351259035077,0.05,0.22246093027343025,0.075,0.0,0.0 9 | 2,,,,,0.11660206718346254,,0.24113475177304963,,0.08333333333333333,,0.08333333333333333,,0.23834634694009693,,0.23827757890257886,,0.0, 10 | S2,,1,1,,0.12856125356125356,,0.30260047281323876,,0.08333333333333333,,0.08333333333333333,,0.26027583527583525,,0.2542317636067636,,0.0, 11 | 3,,,,,0.14057632398753891,,0.3877068557919622,,0.08333333333333333,,0.125,,0.1740246250662917,,0.2822740916490917,,0.0, 12 | S3,,1,0,ACTIVE,0.15193602693602692,0.0,0.41371158392434987,0.0,0.08333333333333333,0.0,0.08333333333333333,0.05,0.2749340936840937,0.17480339105339107,0.26784211159211163,0.1739105339105339,0.0,0.0 13 | 4,,,,ACTIVE,0.1617383512544803,0.12803030303030302,0.44208037825059104,0.06842105263157895,0.08333333333333333,0.1,0.08333333333333333,0.05,0.2706604737854738,0.2297817460317461,0.2675940957190957,0.17480339105339107,0.0,0.0 14 | S4,,1,1,ACTIVE,0.16900749063670412,0.15089285714285716,0.46099290780141844,0.18421052631578946,0.08333333333333333,0.1,0.08333333333333333,0.1,0.28083739177489175,0.22562590187590187,0.273478835978836,0.2297817460317461,0.0,0.0 15 | 5,,,,ACTIVE,0.1728927203065134,0.17604166666666665,0.5177304964539007,0.38421052631578945,0.125,0.15,0.125,0.15,0.18231922398589065,0.16494708994708998,0.29408068783068786,0.2764484126984127,0.0,0.0 16 | S5,,1,1,ACTIVE,0.16900749063670412,0.19204545454545457,0.46099290780141844,0.4052631578947368,0.08333333333333333,0.1,0.08333333333333333,0.1,0.28083739177489175,0.27179563492063497,0.273478835978836,0.26505952380952386,0.0,0.0 17 | 6,,,,ACTIVE,0.1617383512544803,0.2011904761904762,0.44208037825059104,0.4368421052631579,0.08333333333333333,0.1,0.08333333333333333,0.1,0.27066047378547375,0.2696130952380953,0.2675940957190957,0.2671428571428572,0.0,0.0 18 | 6,,1,,ACTIVE,0.1617383512544803,0.2011904761904762,0.44208037825059104,0.4368421052631579,0.08333333333333333,0.1,0.08333333333333333,0.1,0.27066047378547375,0.2696130952380953,0.2675940957190957,0.2671428571428572,0.0,0.0 19 | S6,,1,1,ACTIVE,0.15193602693602692,0.2011904761904762,0.41371158392434987,0.4473684210526316,0.08333333333333333,0.1,0.08333333333333333,0.1,0.2749340936840937,0.2819047619047619,0.2678421115921116,0.27416666666666667,0.0,0.0 20 | 7,,,,ACTIVE,0.14057632398753891,0.19204545454545457,0.39952718676122934,0.48947368421052634,0.125,0.15,0.125,0.15,0.1740246250662917,0.18043650793650792,0.2822740916490917,0.29666666666666663,0.0,0.0 21 | S7,,1,1,ACTIVE,0.12640056022408963,0.169,0.2718676122931442,0.3526315789473684,0.08333333333333333,0.1,0.08333333333333333,0.1,0.2602758352758353,0.27401785714285715,0.25423176360676364,0.2671428571428572,0.0,0.0 22 | 8,,,,ACTIVE,0.11309523809523808,0.1456896551724138,0.20567375886524822,0.2789473684210526,0.08333333333333333,0.1,0.08333333333333333,0.1,0.238346346940097,0.25117063492063496,0.23827757890257892,0.25136904761904766,0.0,0.0 23 | S8,,1,1,ACTIVE,0.10095078299776286,0.12426470588235294,0.13002364066193853,0.18421052631578946,0.08333333333333333,0.1,0.08333333333333333,0.1,0.21971351259035085,0.23168650793650797,0.2224609302734303,0.2351984126984127,0.0,0.0 24 | 9,,,,ACTIVE,0.09006986027944111,0.10562500000000001,0.04491725768321513,0.06842105263157895,0.041666666666666664,0.05,0.08333333333333333,0.1,0.11123046513671515,0.11759920634920636,0.20114944627812278,0.21200396825396828,0.0,0.0 25 | B,,,,ACTIVE,0.0,0.0,0.0,0.0,0.0,0.0,0.041666666666666664,0.05,0.29408068783068786,0.2764484126984127,0.2371362433862434,0.22144841269841273,0.0,0.0 26 | A,,,,ACTIVE,0.0,0.0,0.0,0.0,0.0,0.0,0.041666666666666664,0.05,0.2011494462781227,0.05,0.18055013817881463,0.075,0.0,0.0 27 | C,,,,ACTIVE,0.0,0.0,0.0,0.0,0.0,0.0,0.041666666666666664,0.05,0.2822740916490917,0.29666666666666663,0.2278428747178747,0.23547619047619048,0.0,0.0 28 | -------------------------------------------------------------------------------- /docs/source/_summaries/grape.parallel_general_graph.ParallelGeneralGraph.rst: -------------------------------------------------------------------------------- 1 | grape.parallel\_general\_graph.ParallelGeneralGraph 2 | =================================================== 3 | 4 | .. currentmodule:: grape.parallel_general_graph 5 | 6 | .. autoclass:: ParallelGeneralGraph 7 | 8 | 9 | .. automethod:: __init__ 10 | 11 | 12 | .. rubric:: Methods 13 | 14 | .. autosummary:: 15 | 16 | ~ParallelGeneralGraph.__init__ 17 | ~ParallelGeneralGraph.add_edge 18 | ~ParallelGeneralGraph.add_edges_from 19 | ~ParallelGeneralGraph.add_node 20 | ~ParallelGeneralGraph.add_nodes_from 21 | ~ParallelGeneralGraph.add_weighted_edges_from 22 | ~ParallelGeneralGraph.adjacency 23 | ~ParallelGeneralGraph.betweenness_centrality_kernel 24 | ~ParallelGeneralGraph.calculate_shortest_path 25 | ~ParallelGeneralGraph.clear 26 | ~ParallelGeneralGraph.clear_data 27 | ~ParallelGeneralGraph.clear_edges 28 | ~ParallelGeneralGraph.closeness_centrality_kernel 29 | ~ParallelGeneralGraph.compute_betweenness_centrality 30 | ~ParallelGeneralGraph.compute_closeness_centrality 31 | ~ParallelGeneralGraph.compute_degree_centrality 32 | ~ParallelGeneralGraph.compute_efficiency 33 | ~ParallelGeneralGraph.compute_indegree_centrality 34 | ~ParallelGeneralGraph.compute_local_efficiency 35 | ~ParallelGeneralGraph.compute_nodal_efficiency 36 | ~ParallelGeneralGraph.compute_outdegree_centrality 37 | ~ParallelGeneralGraph.compute_service 38 | ~ParallelGeneralGraph.construct_path_kernel 39 | ~ParallelGeneralGraph.copy 40 | ~ParallelGeneralGraph.degree_centrality_kernel 41 | ~ParallelGeneralGraph.dijkstra_iteration_parallel 42 | ~ParallelGeneralGraph.dijkstra_single_source_shortest_path 43 | ~ParallelGeneralGraph.edge_subgraph 44 | ~ParallelGeneralGraph.efficiency_kernel 45 | ~ParallelGeneralGraph.floyd_warshall_initialization 46 | ~ParallelGeneralGraph.floyd_warshall_kernel 47 | ~ParallelGeneralGraph.floyd_warshall_predecessor_and_distance 48 | ~ParallelGeneralGraph.get_edge_data 49 | ~ParallelGeneralGraph.has_edge 50 | ~ParallelGeneralGraph.has_node 51 | ~ParallelGeneralGraph.has_predecessor 52 | ~ParallelGeneralGraph.has_successor 53 | ~ParallelGeneralGraph.indegree_centrality_kernel 54 | ~ParallelGeneralGraph.is_directed 55 | ~ParallelGeneralGraph.is_multigraph 56 | ~ParallelGeneralGraph.load 57 | ~ParallelGeneralGraph.local_efficiency_kernel 58 | ~ParallelGeneralGraph.measure_iteration 59 | ~ParallelGeneralGraph.measure_processes 60 | ~ParallelGeneralGraph.nbunch_iter 61 | ~ParallelGeneralGraph.neighbors 62 | ~ParallelGeneralGraph.nodal_efficiency_kernel 63 | ~ParallelGeneralGraph.number_of_edges 64 | ~ParallelGeneralGraph.number_of_nodes 65 | ~ParallelGeneralGraph.order 66 | ~ParallelGeneralGraph.outdegree_centrality_kernel 67 | ~ParallelGeneralGraph.predecessors 68 | ~ParallelGeneralGraph.remove_edge 69 | ~ParallelGeneralGraph.remove_edges_from 70 | ~ParallelGeneralGraph.remove_node 71 | ~ParallelGeneralGraph.remove_nodes_from 72 | ~ParallelGeneralGraph.reverse 73 | ~ParallelGeneralGraph.shortest_path_list_iteration 74 | ~ParallelGeneralGraph.shortest_path_list_kernel 75 | ~ParallelGeneralGraph.size 76 | ~ParallelGeneralGraph.subgraph 77 | ~ParallelGeneralGraph.successors 78 | ~ParallelGeneralGraph.to_directed 79 | ~ParallelGeneralGraph.to_directed_class 80 | ~ParallelGeneralGraph.to_undirected 81 | ~ParallelGeneralGraph.to_undirected_class 82 | ~ParallelGeneralGraph.update 83 | 84 | 85 | 86 | 87 | 88 | .. rubric:: Attributes 89 | 90 | .. autosummary:: 91 | 92 | ~ParallelGeneralGraph.adj 93 | ~ParallelGeneralGraph.area 94 | ~ParallelGeneralGraph.betweenness_centrality 95 | ~ParallelGeneralGraph.closeness_centrality 96 | ~ParallelGeneralGraph.degree 97 | ~ParallelGeneralGraph.degree_centrality 98 | ~ParallelGeneralGraph.description 99 | ~ParallelGeneralGraph.edges 100 | ~ParallelGeneralGraph.efficiency 101 | ~ParallelGeneralGraph.father_condition 102 | ~ParallelGeneralGraph.final_status 103 | ~ParallelGeneralGraph.global_efficiency 104 | ~ParallelGeneralGraph.in_degree 105 | ~ParallelGeneralGraph.in_edges 106 | ~ParallelGeneralGraph.indegree_centrality 107 | ~ParallelGeneralGraph.init_status 108 | ~ParallelGeneralGraph.initial_service 109 | ~ParallelGeneralGraph.local_efficiency 110 | ~ParallelGeneralGraph.mark 111 | ~ParallelGeneralGraph.mark_status 112 | ~ParallelGeneralGraph.name 113 | ~ParallelGeneralGraph.nodal_efficiency 114 | ~ParallelGeneralGraph.nodes 115 | ~ParallelGeneralGraph.out_degree 116 | ~ParallelGeneralGraph.out_edges 117 | ~ParallelGeneralGraph.outdegree_centrality 118 | ~ParallelGeneralGraph.perturbation_resistant 119 | ~ParallelGeneralGraph.pred 120 | ~ParallelGeneralGraph.service 121 | ~ParallelGeneralGraph.shortest_path 122 | ~ParallelGeneralGraph.shortest_path_length 123 | ~ParallelGeneralGraph.sources 124 | ~ParallelGeneralGraph.status_area 125 | ~ParallelGeneralGraph.succ 126 | ~ParallelGeneralGraph.switches 127 | ~ParallelGeneralGraph.type 128 | ~ParallelGeneralGraph.users 129 | ~ParallelGeneralGraph.weight 130 | 131 | -------------------------------------------------------------------------------- /tests/test_input_graph.py: -------------------------------------------------------------------------------- 1 | """TestInputGraph to check input of GeneralGraph""" 2 | 3 | from unittest import TestCase 4 | from grape.general_graph import GeneralGraph 5 | 6 | 7 | class TestInputGraph(TestCase): 8 | """ 9 | Class TestInputGraph to check input of GeneralGraph 10 | """ 11 | 12 | def test_Mark(self): 13 | """ 14 | Unittest check for mark attribute of GeneralGraph: 15 | correct input reading. 16 | """ 17 | g = GeneralGraph() 18 | g.load("tests/TOY_graph.csv") 19 | 20 | mark_dict = { 21 | '1': '1', 22 | '2': '2', 23 | '3': '3', 24 | '4': '4', 25 | '5': '5', 26 | '6': '6', 27 | '7': '7', 28 | '8': '8', 29 | '9': '9', 30 | '10': '10', 31 | '11': '11', 32 | '12': '12', 33 | '13': '13', 34 | '14': '14', 35 | '15': '15', 36 | '16': '16', 37 | '17': '17', 38 | '18': '18', 39 | '19': '19' 40 | } 41 | 42 | self.assertDictEqual(mark_dict, g.mark, msg="Wrong MARK in input") 43 | 44 | def test_init_status(self): 45 | """ 46 | Unittest check for init_status attribute of GeneralGraph: 47 | correct input reading. 48 | """ 49 | g = GeneralGraph() 50 | g.load("tests/TOY_graph.csv") 51 | 52 | init_status_dict = {'2': True, '3': True} 53 | 54 | self.assertDictEqual(init_status_dict, g.init_status, 55 | msg="Wrong INIT STATUS in input") 56 | 57 | def test_description(self): 58 | """ 59 | Unittest check for description attribute of GeneralGraph: 60 | correct input reading. 61 | """ 62 | g = GeneralGraph() 63 | g.load("tests/TOY_graph.csv") 64 | 65 | description_dict = { 66 | '1': '', 67 | '2': '', 68 | '3': '', 69 | '4': '', 70 | '5': '', 71 | '6': '', 72 | '7': '', 73 | '8': '', 74 | '9': '', 75 | '10': '', 76 | '11': '', 77 | '12': '', 78 | '13': '', 79 | '14': '', 80 | '15': '', 81 | '16': '', 82 | '17': '', 83 | '18': '', 84 | '19': '' 85 | } 86 | 87 | self.assertDictEqual(description_dict, g.description, 88 | msg=" Wrong DESCRIPTION in input ") 89 | 90 | def test_type(self): 91 | """ 92 | Unittest check for type attribute of GeneralGraph: 93 | correct input reading. 94 | """ 95 | g = GeneralGraph() 96 | g.load("tests/TOY_graph.csv") 97 | 98 | type_dict = { 99 | '1': 'SOURCE', 100 | '2': 'SWITCH', 101 | '3': 'SWITCH', 102 | '4': 'HUB', 103 | '5': 'HUB', 104 | '6': 'HUB', 105 | '7': 'HUB', 106 | '8': 'HUB', 107 | '9': 'HUB', 108 | '10': 'HUB', 109 | '11': 'HUB', 110 | '12': 'HUB', 111 | '13': 'HUB', 112 | '14': 'HUB', 113 | '15': 'SOURCE', 114 | '16': 'HUB', 115 | '17': 'HUB', 116 | '18': 'USER', 117 | '19': 'HUB' 118 | } 119 | 120 | self.assertDictEqual(type_dict, g.type, msg="Wrong TYPE in input") 121 | 122 | def test_weight(self): 123 | """ 124 | Unittest check for Weight attribute of GeneralGraph: 125 | correct input reading. 126 | """ 127 | g = GeneralGraph() 128 | g.load("tests/TOY_graph.csv") 129 | 130 | weight_dict = { 131 | ('1', '2'): 1.0, 132 | ('1', '3'): 1.0, 133 | ('2', '4'): 1.0, 134 | ('3', '5'): 1.0, 135 | ('4', '6'): 1.0, 136 | ('5', '11'): 1.0, 137 | ('6', '7'): 1.0, 138 | ('6', '8'): 1.0, 139 | ('7', '6'): 1.0, 140 | ('8', '6'): 1.0, 141 | ('8', '9'): 1.0, 142 | ('9', '16'): 1.0, 143 | ('15', '9'): 1.0, 144 | ('16', '17'): 1.0, 145 | ('17', '16'): 1.0, 146 | ('17', '10'): 1.0, 147 | ('10', '11'): 1.0, 148 | ('11', '19'): 1.0, 149 | ('19', '12'): 1.0, 150 | ('19', '14'): 1.0, 151 | ('12', '19'): 1.0, 152 | ('12', '13'): 1.0, 153 | ('14', '19'): 1.0, 154 | ('14', '13'): 1.0, 155 | ('14', '18'): 1.0, 156 | ('13', '12'): 1.0, 157 | ('13', '14'): 1.0 158 | } 159 | 160 | self.assertDictEqual(weight_dict, g.weight, msg="Wrong WEIGHT in input") 161 | 162 | def test_initial_service(self): 163 | """ 164 | Unittest check for initial_service attribute of GeneralGraph: 165 | correct input reading. 166 | """ 167 | g = GeneralGraph() 168 | g.load("tests/TOY_graph.csv") 169 | 170 | initial_service_dict = { 171 | '1': 1.0, 172 | '2': 0.0, 173 | '3': 0.0, 174 | '4': 0.0, 175 | '5': 0.0, 176 | '6': 0.0, 177 | '7': 0.0, 178 | '8': 0.0, 179 | '9': 0.0, 180 | '10': 0.0, 181 | '11': 0.0, 182 | '12': 0.0, 183 | '13': 0.0, 184 | '14': 0.0, 185 | '15': 2.0, 186 | '16': 0.0, 187 | '17': 0.0, 188 | '18': 0.0, 189 | '19': 0.0 190 | } 191 | 192 | self.assertDictEqual(initial_service_dict, g.initial_service, 193 | msg=" Wrong INITIAL SERVICE in input ") 194 | 195 | def test_initial_sources(self): 196 | """ 197 | Unittest check for sources of GeneralGraph: correct input reading. 198 | """ 199 | g = GeneralGraph() 200 | g.load("tests/TOY_graph.csv") 201 | 202 | self.assertEqual(['1', '15'], g.sources, msg=" Wrong SOURCES in input ") 203 | 204 | def test_initial_hubs(self): 205 | """ 206 | Unittest check for hubs of GeneralGraph: correct input reading. 207 | """ 208 | g = GeneralGraph() 209 | g.load("tests/TOY_graph.csv") 210 | 211 | self.assertEqual(['4', '5', '6', '7', '8', '9', '16', '17', '10', '11', 212 | '19', '12', '14', '13'], g.hubs, msg=" Wrong HUBS in input ") 213 | 214 | def test_initial_users(self): 215 | """ 216 | Unittest check for users of GeneralGraph: correct input reading. 217 | """ 218 | g = GeneralGraph() 219 | g.load("tests/TOY_graph.csv") 220 | 221 | self.assertEqual(['18'], g.users, msg=" Wrong USERS in input ") 222 | 223 | def test_initial_switches(self): 224 | """ 225 | Unittest check for switches of GeneralGraph: correct input reading. 226 | """ 227 | g = GeneralGraph() 228 | g.load("tests/TOY_graph.csv") 229 | 230 | self.assertEqual(['2', '3'], g.switches, 231 | msg=" Wrong SWITCHES in input ") 232 | -------------------------------------------------------------------------------- /tutorials/tutorial02/output_files/results_generations.dat: -------------------------------------------------------------------------------- 1 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 2 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 3 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 4 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 5 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 6 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 7 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 8 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 9 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 10 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 11 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 12 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 13 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 14 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 15 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 16 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 17 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 18 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 19 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 20 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 21 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 22 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 23 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 24 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 25 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 26 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 27 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 28 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 29 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 30 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 31 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 32 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 33 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 34 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 35 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 36 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 37 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 38 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 39 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 40 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 41 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 42 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 43 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 44 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 45 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 46 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 47 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 48 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 49 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 50 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 51 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 52 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 53 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 54 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 55 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 56 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 57 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 58 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 59 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 60 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 61 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 62 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 63 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 64 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 65 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 66 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 67 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 68 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 69 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 70 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 71 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 72 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 73 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 74 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 75 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 76 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 77 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 78 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 79 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 80 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 81 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 82 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 83 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 84 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 85 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 86 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 87 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 88 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 89 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 90 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 91 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 92 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 93 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 94 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 95 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 96 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 97 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 98 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 99 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 100 | dict_items([('2', True), ('3', True)])[True, False] (1, 0.0, 3, 0, 0)-2.0 101 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |