diff --git a/README.md b/README.md index d4ffedd14..0225e9281 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ streaming graph algorithms! Drop us a message on the channels below: Discord - Memgraph Github + Memgraph GitHub Memgraph YouTube @@ -146,7 +146,7 @@ docker run -p 7687:7687 -p 7444:7444 memgraph/memgraph-mage #### 2 Install MAGE with Docker build of the repository -**0. a** Make sure that you have cloned the MAGE Github repository and positioned +**0. a** Make sure that you have cloned the MAGE GitHub repository and positioned yourself inside the repo in your terminal: ```bash diff --git a/cpp/betweenness_centrality_module/algorithm_online/betweenness_centrality_online.hpp b/cpp/betweenness_centrality_module/algorithm_online/betweenness_centrality_online.hpp index 21edccc0a..3ee32cd11 100644 --- a/cpp/betweenness_centrality_module/algorithm_online/betweenness_centrality_online.hpp +++ b/cpp/betweenness_centrality_module/algorithm_online/betweenness_centrality_online.hpp @@ -188,7 +188,7 @@ class OnlineBC { /// inline bool Initialized() const { return this->initialized; }; - ///@brief Computes initial betweennness centrality scores with Brandes’ algorithm. + ///@brief Computes initial betweenness centrality scores with Brandes’ algorithm. /// ///@param graph Current graph ///@param normalize If true, normalizes each node’s betweenness centrality score by the number of node pairs not @@ -200,8 +200,8 @@ class OnlineBC { std::unordered_map Set(const mg_graph::GraphView<> &graph, const bool normalize = true, const std::uint64_t threads = std::thread::hardware_concurrency()); - ///@brief Returns previously computed betweennness centrality scores. - /// If this->computed flag is set to false, computes betweennness centrality scores with default parameter values. + ///@brief Returns previously computed betweenness centrality scores. + /// If this->computed flag is set to false, computes betweenness centrality scores with default parameter values. /// ///@param graph Current graph ///@param normalize If true, normalizes each node’s betweenness centrality score by the number of node pairs not @@ -211,7 +211,7 @@ class OnlineBC { ///@return {node ID, BC score} pairs std::unordered_map Get(const mg_graph::GraphView<> &graph, const bool normalize = true) const; - ///@brief Uses iCentral to recompute betweennness centrality scores after edge updates. + ///@brief Uses iCentral to recompute betweenness centrality scores after edge updates. /// ///@param prior_graph Graph as before the last update ///@param current_graph Current graph @@ -228,7 +228,7 @@ class OnlineBC { const std::pair updated_edge, const bool normalize = true, const std::uint64_t threads = std::thread::hardware_concurrency()); - ///@brief Uses a single iteration of Brandes’ algorithm to recompute betweennness centrality scores after updates + ///@brief Uses a single iteration of Brandes’ algorithm to recompute betweenness centrality scores after updates /// consisting of an edge and a node solely connected to it. /// ///@param current_graph Current graph diff --git a/cpp/betweenness_centrality_module/betweenness_centrality_online_module.cpp b/cpp/betweenness_centrality_module/betweenness_centrality_online_module.cpp index ad0e875a6..e439659b2 100644 --- a/cpp/betweenness_centrality_module/betweenness_centrality_online_module.cpp +++ b/cpp/betweenness_centrality_module/betweenness_centrality_online_module.cpp @@ -137,7 +137,7 @@ void Update(mgp_list *args, mgp_graph *memgraph_graph, mgp_result *result, mgp_m // Check if online update can be used if (created_nodes.size() == 0 && deleted_nodes.size() == 0) { // Edge update - // Get edges as before before the update + // Get edges as before the update std::vector> prior_edges_ids; for (const auto edge_inner_ids : graph->Edges()) { const std::pair edge{graph->GetMemgraphNodeId(edge_inner_ids.from), diff --git a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/parallelLouvainMethodApprox-2.cpp b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/parallelLouvainMethodApprox-2.cpp index 3d55d8c75..19b6b285b 100644 --- a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/parallelLouvainMethodApprox-2.cpp +++ b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/parallelLouvainMethodApprox-2.cpp @@ -65,7 +65,7 @@ double parallelLouvianMethodApprox2(graph *G, mgp_graph *mg_graph, long *C, int #endif double time1, time2, time3, time4; //For timing purposes double total = 0, totItr = 0; - //long percentange = clustering_parameters.percentage; + //long percentage = clustering_parameters.percentage; long NV = G->numVertices; long NS = G->sVertices; long NE = G->numEdges; diff --git a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/parallelLouvainMethodApprox.cpp b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/parallelLouvainMethodApprox.cpp index efd628256..0078dc2ec 100644 --- a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/parallelLouvainMethodApprox.cpp +++ b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/parallelLouvainMethodApprox.cpp @@ -64,7 +64,7 @@ double parallelLouvianMethodApprox(graph *G, mgp_graph *mg_graph, long *C, int n #endif double time1, time2, time3, time4; //For timing purposes double total = 0, totItr = 0; - //long percentange = clustering_parameters.percentage; + //long percentage = clustering_parameters.percentage; long NV = G->numVertices; long NS = G->sVertices; long NE = G->numEdges; @@ -201,7 +201,7 @@ int x = NV*percentage/100; Counter.clear(); }else { - targetCommAss[i]=currCommAss[i];//(int)rand()%(NV*percentange/100); + targetCommAss[i]=currCommAss[i];//(int)rand()%(NV*percentage/100); } //Update if(targetCommAss[i] != currCommAss[i] && targetCommAss[i] != -1) { diff --git a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runDirectedMultiPhaseBasic.cpp b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runDirectedMultiPhaseBasic.cpp index 9632ce6da..78ec9ac5f 100644 --- a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runDirectedMultiPhaseBasic.cpp +++ b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runDirectedMultiPhaseBasic.cpp @@ -88,7 +88,7 @@ void runMultiPhaseBasicDirected(graph *G, mgp_graph *mg_graph, long *C_orig, int totTimeClustering += tmpTime; totItr += tmpItr; - //Renumber the clusters contiguiously + //Renumber the clusters contiguously numClusters = renumberClustersContiguously(C, G->numVertices); //Keep track of clusters in C_orig @@ -187,7 +187,7 @@ void runMultiPhaseBasicOnceDirected(graph *G, mgp_graph *mg_graph, long *C_orig, totTimeClustering += tmpTime; totItr += tmpItr; - //Renumber the clusters contiguiously + //Renumber the clusters contiguously numClusters = renumberClustersContiguously(C, G->numVertices); //Keep track of clusters in C_orig diff --git a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runMultiPhaseBasic.cpp b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runMultiPhaseBasic.cpp index 247063f2f..f1678832d 100644 --- a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runMultiPhaseBasic.cpp +++ b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runMultiPhaseBasic.cpp @@ -89,7 +89,7 @@ void runMultiPhaseBasic(graph *G, mgp_graph *mg_graph, long *C_orig, int basicOp totTimeClustering += tmpTime; totItr += tmpItr; - //Renumber the clusters contiguiously + //Renumber the clusters contiguously numClusters = renumberClustersContiguously(C, G->numVertices); //Keep track of clusters in C_orig if(phase == 1) { @@ -186,7 +186,7 @@ void runMultiPhaseBasicOnce(graph *G, mgp_graph *mg_graph, long *C_orig, int bas totTimeClustering += tmpTime; totItr += tmpItr; - //Renumber the clusters contiguiously + //Renumber the clusters contiguously numClusters = renumberClustersContiguously(C, G->numVertices); //Keep track of clusters in C_orig diff --git a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runMultiPhaseBasicApprox.cpp b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runMultiPhaseBasicApprox.cpp index e46221d10..97fa9b34a 100644 --- a/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runMultiPhaseBasicApprox.cpp +++ b/cpp/community_detection_module/grappolo/BasicCommunitiesDetection/runMultiPhaseBasicApprox.cpp @@ -56,7 +56,7 @@ void runMultiPhaseBasicApprox(graph *G, mgp_graph *mg_graph, long *C_orig, int b int tmpItr=0, totItr = 0; long NV = G->numVertices; - long percentange = 80; + long percentage = 80; /* Step 1: Find communities */ double prevMod = -1; double currMod = -1; @@ -87,7 +87,7 @@ void runMultiPhaseBasicApprox(graph *G, mgp_graph *mg_graph, long *C_orig, int b totTimeClustering += tmpTime; totItr += tmpItr; - //Renumber the clusters contiguiously + //Renumber the clusters contiguously numClusters = renumberClustersContiguously(C, G->numVertices); //Keep track of clusters in C_orig diff --git a/cpp/community_detection_module/grappolo/CMakeLists.txt b/cpp/community_detection_module/grappolo/CMakeLists.txt index 534f977ea..fac572ba7 100644 --- a/cpp/community_detection_module/grappolo/CMakeLists.txt +++ b/cpp/community_detection_module/grappolo/CMakeLists.txt @@ -1,7 +1,7 @@ # Nitin A. Gawande, PNNL # Oct 19, 2018 -# set varaibles using nomenclature used in Makefile +# set variables using nomenclature used in Makefile set(MODULE_DIR community_detection_module/grappolo) set(COFOLDER BasicCommunitiesDetection) set(UTFOLDER Utility) diff --git a/cpp/community_detection_module/grappolo/Coloring/parallelLouvainWithColoring.cpp b/cpp/community_detection_module/grappolo/Coloring/parallelLouvainWithColoring.cpp index 0725c82dc..d339d3a8d 100644 --- a/cpp/community_detection_module/grappolo/Coloring/parallelLouvainWithColoring.cpp +++ b/cpp/community_detection_module/grappolo/Coloring/parallelLouvainWithColoring.cpp @@ -63,14 +63,14 @@ double algoLouvainWithDistOneColoring(graph* G, mgp_graph *mg_graph, long *C, in double time1, time2, time3, time4; //For timing purposes double total = 0, totItr = 0; - /* Indexs are vertex */ + /* Indexes are vertex */ long* pastCommAss; //Store previous iteration's community assignment long* currCommAss; //Store current community assignment //long* targetCommAss; //Store the target of community assignment double* vDegree; //Store each vertex's degree double* clusterWeightInternal;//use for Modularity calculation (eii) - /* Indexs are community */ + /* Indexes are community */ Comm* cInfo; //Community info. (ai and size) Comm* cUpdate; //use for updating Community diff --git a/cpp/community_detection_module/grappolo/Coloring/parallelLouvainWithColoringNoMap.cpp b/cpp/community_detection_module/grappolo/Coloring/parallelLouvainWithColoringNoMap.cpp index 8fd0602cc..85ff25616 100644 --- a/cpp/community_detection_module/grappolo/Coloring/parallelLouvainWithColoringNoMap.cpp +++ b/cpp/community_detection_module/grappolo/Coloring/parallelLouvainWithColoringNoMap.cpp @@ -62,14 +62,14 @@ double algoLouvainWithDistOneColoringNoMap(graph* G, long *C, int nThreads, int* double time1, time2, time3, time4; //For timing purposes double total = 0, totItr = 0; - /* Indexs are vertex */ + /* Indexes are vertex */ long* pastCommAss; //Store previous iteration's community assignment long* currCommAss; //Store current community assignment //long* targetCommAss; //Store the target of community assignment double* vDegree; //Store each vertex's degree double* clusterWeightInternal;//use for Modularity calculation (eii) - /* Indexs are community */ + /* Indexes are community */ Comm* cInfo; //Community info. (ai and size) Comm* cUpdate; //use for updating Community diff --git a/cpp/community_detection_module/grappolo/Coloring/runMultiPhaseColoring.cpp b/cpp/community_detection_module/grappolo/Coloring/runMultiPhaseColoring.cpp index 427bee5ff..361a4c951 100644 --- a/cpp/community_detection_module/grappolo/Coloring/runMultiPhaseColoring.cpp +++ b/cpp/community_detection_module/grappolo/Coloring/runMultiPhaseColoring.cpp @@ -119,7 +119,7 @@ void runMultiPhaseColoring(graph *G, mgp_graph *mg_graph, long *C_orig, int colo totItr += tmpItr; nonColor = true; } - //Renumber the clusters contiguiously + //Renumber the clusters contiguously numClusters = renumberClustersContiguously(C, G->numVertices); //Keep track of clusters in C_orig diff --git a/cpp/community_detection_module/grappolo/Coloring/vBase.cpp b/cpp/community_detection_module/grappolo/Coloring/vBase.cpp index 070ebed90..97f821e99 100644 --- a/cpp/community_detection_module/grappolo/Coloring/vBase.cpp +++ b/cpp/community_detection_module/grappolo/Coloring/vBase.cpp @@ -2,7 +2,7 @@ #include "defs.h" #include "coloring.h" -/* The redistritbuted coloring step, no balance */ +/* The redistributed coloring step, no balance */ int vBaseRedistribution(graph* G, int* vtxColor, int ncolors, int type) { #ifdef PRINT_DETAILED_STATS_ @@ -81,7 +81,7 @@ int vBaseRedistribution(graph* G, int* vtxColor, int ncolors, int type) if(freq[ci]>avg) overSize[ci]= true; - /* Begining of Redistribution */ + /* Beginning of Redistribution */ std::cout << "VR start "<< std::endl; diff --git a/cpp/community_detection_module/grappolo/DefineStructure/basic_util.h b/cpp/community_detection_module/grappolo/DefineStructure/basic_util.h index 7712cb662..aca614d8e 100644 --- a/cpp/community_detection_module/grappolo/DefineStructure/basic_util.h +++ b/cpp/community_detection_module/grappolo/DefineStructure/basic_util.h @@ -1,5 +1,5 @@ -#ifndef __UTILITLY__ -#define __UTILITLY__ +#ifndef __UTILITY__ +#define __UTILITY__ // Define in buildNextPhase.cpp long renumberClustersContiguously(long *C, long size); diff --git a/cpp/community_detection_module/grappolo/DefineStructure/coloring.h b/cpp/community_detection_module/grappolo/DefineStructure/coloring.h index 4f505d3d9..00c88d11b 100644 --- a/cpp/community_detection_module/grappolo/DefineStructure/coloring.h +++ b/cpp/community_detection_module/grappolo/DefineStructure/coloring.h @@ -14,7 +14,7 @@ int algoColoringMultiHashMaxMin(graph *G, int *vtxColor, int nThreads, double *t // In vBase.cpp int vBaseRedistribution(graph* G, int* vtxColor, int ncolors, int type); -// In equtiableColoringDistanceOne.cpp +// In equitableColoringDistanceOne.cpp void buildColorSize(long NVer, int *vtxColor, int numColors, long *colorSize); void computeVariance(long NVer, int numColors, long *colorSize); diff --git a/cpp/community_detection_module/grappolo/DefineStructure/coloringUtils.h b/cpp/community_detection_module/grappolo/DefineStructure/coloringUtils.h index 0c5baceb5..d13b3ef76 100644 --- a/cpp/community_detection_module/grappolo/DefineStructure/coloringUtils.h +++ b/cpp/community_detection_module/grappolo/DefineStructure/coloringUtils.h @@ -43,7 +43,7 @@ void distanceOneConfResolution(graph* G, long v, int* vtxColor, double* randValu void distanceOneChecked(graph* G, long nv ,int* colors); void buildColorsIndex(int* colors, const int numColors, const long nv, ColorVector& colorPtr, ColorVector& colorIndex, ColorVector& binSizes); -/******* UtiliyFunctions ***** +/******* UtilityFunctions ***** void computeBinSizes(ColorVector &binSizes, const ColorVector &colors, const GraphElem nv, const ColorElem numColors); ColorElem getDegree(const GraphElem ci, const Graph &g); void computeBinSizesWeighted(ColorVector &binSizes, const ColorVector &colors, const GraphElem nv, const ColorElem numColors, const Graph &g); @@ -67,7 +67,7 @@ void generateRandomNumbers(std::vector &randVec); /* Basic coloring (unbalanced) in initialColoring.cpp ColorElem initColoring(const Graph &g, ColorVector &colors, std::string input); -/* Basic coloiring (ab-inital) in initialColoringLU.cpp +/* Basic coloring (ab-inital) in initialColoringLU.cpp ColorElem initColoringLU(const Graph &g, ColorVector &colors, std::string input); /* Vertex base redistribution in vBase.cpp diff --git a/cpp/community_detection_module/grappolo/DefineStructure/utilityGraphPartitioner.h b/cpp/community_detection_module/grappolo/DefineStructure/utilityGraphPartitioner.h index 9fa875087..48e526894 100644 --- a/cpp/community_detection_module/grappolo/DefineStructure/utilityGraphPartitioner.h +++ b/cpp/community_detection_module/grappolo/DefineStructure/utilityGraphPartitioner.h @@ -186,7 +186,7 @@ void MetisGraphPartitioner( graph *G, long *VertexPartitioning, int numParts ) { VertexPartitioning[i] = (long) part[i]; //Do explicit typecasts } - //Cleaup: + //Cleanup: free(xadj); free(adjncy); free(adjwgt); free(part); } diff --git a/cpp/community_detection_module/grappolo/DefineStructure/utilityNestedDisectionMetis.h b/cpp/community_detection_module/grappolo/DefineStructure/utilityNestedDisectionMetis.h index 1ad9e1e2d..ba14ad7d4 100644 --- a/cpp/community_detection_module/grappolo/DefineStructure/utilityNestedDisectionMetis.h +++ b/cpp/community_detection_module/grappolo/DefineStructure/utilityNestedDisectionMetis.h @@ -39,8 +39,8 @@ // // ************************************************************************ -#ifndef _graph_NestDisect_ -#define _graph_NestDisect_ +#ifndef _graph_NestDissect_ +#define _graph_NestDissect_ /* int METIS NodeND(idx t *nvtxs, idx t *xadj, idx t *adjncy, idx t *vwgt, idx t *options, @@ -165,7 +165,7 @@ void MetisNDReorder( graph *G, long *old2NewMap ) { old2NewMap[i] = (long) perm[i]; //Do explicit typecasts } - //Cleaup: + //Cleanup: free(xadj); free(adjncy); free(adjwgt); free(perm); free(iperm); } diff --git a/cpp/community_detection_module/grappolo/FullSyncOptimization/parallelLouvainMethodEarlyTerminate.cpp b/cpp/community_detection_module/grappolo/FullSyncOptimization/parallelLouvainMethodEarlyTerminate.cpp index 5f846f03e..cc3c26ef4 100644 --- a/cpp/community_detection_module/grappolo/FullSyncOptimization/parallelLouvainMethodEarlyTerminate.cpp +++ b/cpp/community_detection_module/grappolo/FullSyncOptimization/parallelLouvainMethodEarlyTerminate.cpp @@ -181,7 +181,7 @@ double parallelLouvianMethodEarlyTerminate(graph *G, long *C, int nThreads, doub //totalUniqueComm += numUniqueClusters; if((numItrs > 1) && (targetCommAss[i] == pastCommAss[i]) && (targetCommAss[i]==currCommAss[i]) ){ - verT[i] = true; //Commuity assignment has not changed + verT[i] = true; //Community assignment has not changed __sync_fetch_and_add(&termNodes, 1); //Update the number of terminated nodes } diff --git a/cpp/community_detection_module/grappolo/FullSyncOptimization/parallelLouvainMethodFullSyncEarly.cpp b/cpp/community_detection_module/grappolo/FullSyncOptimization/parallelLouvainMethodFullSyncEarly.cpp index 058eae48e..39120e322 100644 --- a/cpp/community_detection_module/grappolo/FullSyncOptimization/parallelLouvainMethodFullSyncEarly.cpp +++ b/cpp/community_detection_module/grappolo/FullSyncOptimization/parallelLouvainMethodFullSyncEarly.cpp @@ -167,7 +167,7 @@ double parallelLouvainMethodFullSyncEarly(graph *G, long *C, int nThreads, doubl //assert((targetCommAss[i] >= 0)&&(targetCommAss[i] < NV)); if(numItrs > 2 && C[i] == currCommAss[i] && pastCommAss[i]==currCommAss[i]){ - //Swaping!!! + //Swapping!!! verT[i] = true; termNodes++; } diff --git a/cpp/community_detection_module/grappolo/FullSyncOptimization/runMultiPhaseSyncType.cpp b/cpp/community_detection_module/grappolo/FullSyncOptimization/runMultiPhaseSyncType.cpp index 0cf716839..b3bfdcc10 100644 --- a/cpp/community_detection_module/grappolo/FullSyncOptimization/runMultiPhaseSyncType.cpp +++ b/cpp/community_detection_module/grappolo/FullSyncOptimization/runMultiPhaseSyncType.cpp @@ -111,7 +111,7 @@ void runMultiPhaseSyncType(graph *G, mgp_graph *mg_graph, long *C_orig, int sync totTimeClustering += tmpTime; totItr += tmpItr; - //Renumber the clusters contiguiously + //Renumber the clusters contiguously numClusters = renumberClustersContiguously(C, G->numVertices); //Keep track of clusters in C_orig diff --git a/cpp/community_detection_module/grappolo/Utility/buildNextPhase.cpp b/cpp/community_detection_module/grappolo/Utility/buildNextPhase.cpp index ab9273de8..95d197a10 100644 --- a/cpp/community_detection_module/grappolo/Utility/buildNextPhase.cpp +++ b/cpp/community_detection_module/grappolo/Utility/buildNextPhase.cpp @@ -94,7 +94,7 @@ double buildNextLevelGraphOpt(graph *Gin, mgp_graph *mg_graph, graph *Gout, long } #ifdef PRINT_DETAILED_STATS_ #endif - long percentange = 80; + long percentage = 80; double time1, time2, TotTime=0; //For timing purposes double total = 0, totItr = 0; //Pointers into the input graph structure: @@ -271,7 +271,7 @@ void buildNextLevelGraph(graph *Gin, graph *Gout, long *C, long numUniqueCluster #endif double time1, time2, time3, time4; //For timing purposes double total = 0, totItr = 0; - long percentange = 80; + long percentage = 80; //Pointers into the input graph structure: long NV_in = Gin->numVertices; long NE_in = Gin->numEdges; @@ -432,7 +432,7 @@ long buildCommunityBasedOnVoltages(graph *G, long *Volts, long *C, long *Cvolts) //Recursive call for finding neighbors inline void Visit(long v, long myCommunity, short *Visited, long *Volts, long* vtxPtr, edge* vtxInd, long *C) { - long adj1 = vtxPtr[v]; //Begining + long adj1 = vtxPtr[v]; //Beginning long adj2 = vtxPtr[v+1]; //End for(long i=adj1; iedgeListPtrs; long tNV = NV; //Number of vertices - if ( (NS == 0)||(NS == NV) ) { //Nonbiparite graph + if ( (NS == 0)||(NS == NV) ) { //Nonbipartite graph for (long i = 0; i < NV; i++) { long degree = vtxPtr[i+1] - vtxPtr[i]; sum_sq += degree*degree; @@ -202,7 +202,7 @@ void displayGraphCharacteristics(graph *G) { }//End of nonbipartite graph else { //Bipartite graph - //Compute characterisitcs from S side: + //Compute characteristics from S side: for (long i = 0; i < NS; i++) { long degree = vtxPtr[i+1] - vtxPtr[i]; sum_sq += degree*degree; @@ -224,7 +224,7 @@ void displayGraphCharacteristics(graph *G) { sum_sq = 0; maxDegree = 0; isolated = 0; - //Compute characterisitcs from T side: + //Compute characteristics from T side: for (long i = NS; i < NV; i++) { long degree = vtxPtr[i+1] - vtxPtr[i]; sum_sq += degree*degree; diff --git a/cpp/community_detection_module/grappolo/Utility/utilitySparsificationFunctions.cpp b/cpp/community_detection_module/grappolo/Utility/utilitySparsificationFunctions.cpp index e4ac5a47c..652d977ae 100644 --- a/cpp/community_detection_module/grappolo/Utility/utilitySparsificationFunctions.cpp +++ b/cpp/community_detection_module/grappolo/Utility/utilitySparsificationFunctions.cpp @@ -202,7 +202,7 @@ double* computeEdgeSimilarityMetrics(graph *G) { }//End of while(c1,c2) //Now compute the similarity score: double similarity = 0; - if (setUnion > 0) //Avoind division by zero + if (setUnion > 0) //Avoid division by zero similarity = setIntersect / setUnion; simWeights[i] = similarity; //Find the position for edge (w --> v) @@ -257,7 +257,7 @@ graph* buildSparifiedGraph(graph *Gin, double alpha) { //Process all the neighbors of v: for(long i = adj1+1; i < adj2; i++ ) { //Always maintain the least weighted neighbor for each vertex; - //... this neigbor will get bounced if there is no space + //... this neighbor will get bounced if there is no space if(edgesAddedSoFar < numTopEdges) { //Add the current edge to the list of top-k edges: isEdgePresent[i] = true; //Mark this edge as true diff --git a/cpp/cugraph_cmake/cugraph.cmake b/cpp/cugraph_cmake/cugraph.cmake index ebbbab8d3..710dc87c8 100644 --- a/cpp/cugraph_cmake/cugraph.cmake +++ b/cpp/cugraph_cmake/cugraph.cmake @@ -14,7 +14,7 @@ # NOTES: # -# Install Cuda manually from from https://developer.nvidia.com/cuda-downloads +# Install Cuda manually from https://developer.nvidia.com/cuda-downloads # because cugraph requires Cuda 11+. In fact, don't use system Cuda because # CMake easily detects that one. export PATH="/usr/local/cuda/bin:$PATH" is # your friend. diff --git a/cpp/cugraph_module/algorithms/graph_generator.cu b/cpp/cugraph_module/algorithms/graph_generator.cu index f1a4956cb..3582b7612 100644 --- a/cpp/cugraph_module/algorithms/graph_generator.cu +++ b/cpp/cugraph_module/algorithms/graph_generator.cu @@ -92,7 +92,7 @@ void GenerateRMAT(mgp_list *args, mgp_graph *graph, mgp_result *result, mgp_memo mgp_edge_destroy(new_edge); } - InsertMessageRecord(result, memory, "Graph created sucessfully!"); + InsertMessageRecord(result, memory, "Graph created successfully!"); } catch (const std::exception &e) { // We must not let any exceptions out of our module. mgp::result_set_error_msg(result, e.what()); diff --git a/cpp/cugraph_module/algorithms/leiden.cu b/cpp/cugraph_module/algorithms/leiden.cu index dcca27875..ec6e74bd9 100644 --- a/cpp/cugraph_module/algorithms/leiden.cu +++ b/cpp/cugraph_module/algorithms/leiden.cu @@ -48,7 +48,7 @@ void InsertLeidenRecord(mgp_graph *graph, mgp_result *result, mgp_memory *memory void LeidenProc(mgp_list *args, mgp_graph *graph, mgp_result *result, mgp_memory *memory) { try { auto max_iterations = mgp::value_get_int(mgp::list_at(args, 0)); - auto resulution = mgp::value_get_double(mgp::list_at(args, 1)); + auto resolution = mgp::value_get_double(mgp::list_at(args, 1)); auto mg_graph = mg_utility::GetGraphView(graph, result, memory, mg_graph::GraphType::kUndirectedGraph); if (mg_graph->Empty()) return; @@ -66,7 +66,7 @@ void LeidenProc(mgp_list *args, mgp_graph *graph, mgp_result *result, mgp_memory cu_graph_view.prop.directed = false; rmm::device_uvector clustering_result(n_vertices, stream); - cugraph::leiden(handle, cu_graph_view, clustering_result.data(), max_iterations, resulution); + cugraph::leiden(handle, cu_graph_view, clustering_result.data(), max_iterations, resolution); for (vertex_t node_id = 0; node_id < clustering_result.size(); ++node_id) { auto partition = clustering_result.element(node_id, stream); diff --git a/cpp/cugraph_module/algorithms/pagerank.cu b/cpp/cugraph_module/algorithms/pagerank.cu index 42686c34e..266518d5f 100644 --- a/cpp/cugraph_module/algorithms/pagerank.cu +++ b/cpp/cugraph_module/algorithms/pagerank.cu @@ -73,7 +73,7 @@ void PagerankProc(mgp_list *args, mgp_graph *graph, mgp_result *result, mgp_memo // IMPORTANT: store_transposed has to be true because cugraph::pagerank // only accepts true. It's hard to detect/debug problem because nvcc error // messages contain only the top call details + graph_view has many - // template paremeters. + // template parameters. cugraph::pagerank(handle, cu_graph_view, std::nullopt, std::nullopt, std::nullopt, std::nullopt, pagerank_results.data(), damping_factor, stop_epsilon, max_iterations); diff --git a/cpp/cugraph_module/algorithms/personalized_pagerank.cu b/cpp/cugraph_module/algorithms/personalized_pagerank.cu index 021690da8..12a0cc046 100644 --- a/cpp/cugraph_module/algorithms/personalized_pagerank.cu +++ b/cpp/cugraph_module/algorithms/personalized_pagerank.cu @@ -77,7 +77,7 @@ void PersonalizedPagerankProc(mgp_list *args, mgp_graph *graph, mgp_result *resu // IMPORTANT: store_transposed has to be true because cugraph::pagerank // only accepts true. It's hard to detect/debug problem because nvcc error // messages contain only the top call details + graph_view has many - // template paremeters. + // template parameters. std::vector v_personalization_values(mgp::list_size(l_personalization_values)); for (std::size_t i = 0; i < mgp::list_size(l_personalization_values); i++) { v_personalization_values.at(i) = mgp::value_get_double(mgp::list_at(l_personalization_values, i)); diff --git a/cpp/cycles_module/algorithm/cycles.cpp b/cpp/cycles_module/algorithm/cycles.cpp index 0a65b113b..4c597a54e 100644 --- a/cpp/cycles_module/algorithm/cycles.cpp +++ b/cpp/cycles_module/algorithm/cycles.cpp @@ -56,11 +56,11 @@ void FindNonSpanningTreeEdges(std::uint64_t node_id, const mg_graph::GraphView<> void FindFundamentalCycles(const std::set> &non_st_edges, const NodeState &state, std::vector> *fundamental_cycles) { for (const auto &[from, to] : non_st_edges) { - fundamental_cycles->emplace_back(FindFundametalCycle(from, to, state)); + fundamental_cycles->emplace_back(FindFundamentalCycle(from, to, state)); } } -std::vector FindFundametalCycle(std::uint64_t node_a, std::uint64_t node_b, const NodeState &state) { +std::vector FindFundamentalCycle(std::uint64_t node_a, std::uint64_t node_b, const NodeState &state) { std::vector cycle; if (state.depth[node_a] < state.depth[node_b]) { std::swap(node_a, node_b); diff --git a/cpp/cycles_module/algorithm/cycles.hpp b/cpp/cycles_module/algorithm/cycles.hpp index 4d6c3cc3e..f78176f78 100644 --- a/cpp/cycles_module/algorithm/cycles.hpp +++ b/cpp/cycles_module/algorithm/cycles.hpp @@ -49,17 +49,17 @@ void FindNonSpanningTreeEdges(uint64_t node_id, const mg_graph::GraphView<> &gra /// ///@param node_a First edge node ///@param node_b Second edge node -///@param state Current cylce detection algorithm state +///@param state Current cycle detection algorithm state ///@return std::vector Container with fundamental cycle /// -std::vector FindFundametalCycle(std::uint64_t node_a, std::uint64_t node_b, const NodeState &state); +std::vector FindFundamentalCycle(std::uint64_t node_a, std::uint64_t node_b, const NodeState &state); /// ///@brief Function for finding all fundamental cycles from the edges not included on the spanning tree. Result is stored /// in \a fundamental_cycles container /// ///@param non_st_edges Non spanning tree edges container -///@param state Current cylce detection algorithm state +///@param state Current cycle detection algorithm state ///@param fundamental_cycles Container containing all fundamental cycles /// void FindFundamentalCycles(const std::set> &non_st_edges, @@ -79,7 +79,7 @@ void CombineCycles(std::uint32_t mask, const std::vector &graph, std::vector>> *cycles); /// -///@brief Method for getting cycles from the found fundamental ones. This method explores 2^funtamental_cycles_size +///@brief Method for getting cycles from the found fundamental ones. This method explores 2^fundamental_cycles_size /// different options of combining cycles (because combination of cycle can also be a cycle) /// ///@param fundamental_cycles Fundamental cycles found by exploring spanning tree diff --git a/cpp/degree_centrality_module/algorithm/degree_centrality.cpp b/cpp/degree_centrality_module/algorithm/degree_centrality.cpp index 313897b3e..ec2108375 100644 --- a/cpp/degree_centrality_module/algorithm/degree_centrality.cpp +++ b/cpp/degree_centrality_module/algorithm/degree_centrality.cpp @@ -1,6 +1,6 @@ #include "degree_centrality.hpp" -namespace degree_cenntrality_alg { +namespace degree_centrality_alg { std::vector GetDegreeCentrality(const mg_graph::GraphView<> &graph, const AlgorithmType algorithm_type) { auto nodes = graph.Nodes(); @@ -33,4 +33,4 @@ std::vector GetDegreeCentrality(const mg_graph::GraphView<> &graph, cons return degree_centralities; } -} // namespace degree_cenntrality_alg +} // namespace degree_centrality_alg diff --git a/cpp/degree_centrality_module/algorithm/degree_centrality.hpp b/cpp/degree_centrality_module/algorithm/degree_centrality.hpp index b93303e8b..5435ce3f4 100644 --- a/cpp/degree_centrality_module/algorithm/degree_centrality.hpp +++ b/cpp/degree_centrality_module/algorithm/degree_centrality.hpp @@ -2,10 +2,10 @@ #include -namespace degree_cenntrality_alg { +namespace degree_centrality_alg { enum class AlgorithmType { kUndirected = 0, kOut = 1, kIn = 2 }; std::vector GetDegreeCentrality(const mg_graph::GraphView<> &graph, const AlgorithmType algorithm_type); -} // namespace degree_cenntrality_alg +} // namespace degree_centrality_alg diff --git a/cpp/degree_centrality_module/degree_centrality_module.cpp b/cpp/degree_centrality_module/degree_centrality_module.cpp index a10f75be4..c356afe69 100644 --- a/cpp/degree_centrality_module/degree_centrality_module.cpp +++ b/cpp/degree_centrality_module/degree_centrality_module.cpp @@ -31,16 +31,16 @@ void InsertDegreeCentralityRecord(mgp_graph *graph, mgp_result *result, mgp_memo mg_utility::InsertDoubleValueResult(record, kFieldDegree, degree, memory); } -degree_cenntrality_alg::AlgorithmType ParseType(mgp_value *algorithm_type) { - if (mgp::value_is_null(algorithm_type)) return degree_cenntrality_alg::AlgorithmType::kUndirected; +degree_centrality_alg::AlgorithmType ParseType(mgp_value *algorithm_type) { + if (mgp::value_is_null(algorithm_type)) return degree_centrality_alg::AlgorithmType::kUndirected; auto algorithm_type_str = std::string(mgp::value_get_string(algorithm_type)); std::transform(algorithm_type_str.begin(), algorithm_type_str.end(), algorithm_type_str.begin(), [](unsigned char c) { return std::tolower(c); }); - if (algorithm_type_str == kAlgorithmUndirected) return degree_cenntrality_alg::AlgorithmType::kUndirected; - if (algorithm_type_str == kAlgorithmOut) return degree_cenntrality_alg::AlgorithmType::kOut; - if (algorithm_type_str == kAlgorithmIn) return degree_cenntrality_alg::AlgorithmType::kIn; + if (algorithm_type_str == kAlgorithmUndirected) return degree_centrality_alg::AlgorithmType::kUndirected; + if (algorithm_type_str == kAlgorithmOut) return degree_centrality_alg::AlgorithmType::kOut; + if (algorithm_type_str == kAlgorithmIn) return degree_centrality_alg::AlgorithmType::kIn; throw std::runtime_error("Unsupported algorithm type. Pick between out/in or undirected"); } @@ -62,7 +62,7 @@ void GetDegreeCentralityWrapper(mgp_list *args, mgp_graph *memgraph_graph, mgp_r : mg_utility::GetGraphView(memgraph_graph, result, memory, mg_graph::GraphType::kDirectedGraph); auto algorithm_type = ParseType(algorithm_type_value); - auto degree_centralities = degree_cenntrality_alg::GetDegreeCentrality(*graph, algorithm_type); + auto degree_centralities = degree_centrality_alg::GetDegreeCentrality(*graph, algorithm_type); for (const auto [node_id] : graph->Nodes()) { auto centrality = degree_centralities[node_id]; diff --git a/cpp/degree_centrality_module/degree_centrality_test.cpp b/cpp/degree_centrality_module/degree_centrality_test.cpp index d75b54721..a0b0af055 100644 --- a/cpp/degree_centrality_module/degree_centrality_test.cpp +++ b/cpp/degree_centrality_module/degree_centrality_test.cpp @@ -9,13 +9,13 @@ class DegreeCentralityTest : public testing::TestWithParam< - std::tuple, std::vector, degree_cenntrality_alg::AlgorithmType>> {}; + std::tuple, std::vector, degree_centrality_alg::AlgorithmType>> {}; TEST_P(DegreeCentralityTest, ParametrizedTest) { auto graph = std::get<0>(GetParam()); auto expected = std::get<1>(GetParam()); auto algorithm_type = std::get<2>(GetParam()); - auto results = degree_cenntrality_alg::GetDegreeCentrality(graph, algorithm_type); + auto results = degree_centrality_alg::GetDegreeCentrality(graph, algorithm_type); ASSERT_TRUE(mg_test_utility::TestEqualVectors(results, expected)); } @@ -23,16 +23,16 @@ INSTANTIATE_TEST_SUITE_P( DegreeCentrality, DegreeCentralityTest, testing::Values( std::make_tuple(*mg_generate::BuildGraph(0, {}, mg_graph::GraphType::kDirectedGraph), std::vector{}, - degree_cenntrality_alg::AlgorithmType::kUndirected), + degree_centrality_alg::AlgorithmType::kUndirected), std::make_tuple(*mg_generate::BuildGraph(5, {{0, 4}, {2, 3}}, mg_graph::GraphType::kDirectedGraph), std::vector{0.2500, 0.0000, 0.2500, 0.2500, 0.2500}, - degree_cenntrality_alg::AlgorithmType::kUndirected), + degree_centrality_alg::AlgorithmType::kUndirected), std::make_tuple( *mg_generate::BuildGraph( 10, {{0, 4}, {0, 8}, {1, 5}, {1, 8}, {2, 6}, {3, 5}, {4, 7}, {5, 6}, {5, 8}, {6, 8}, {7, 9}, {8, 9}}, mg_graph::GraphType::kDirectedGraph), std::vector{0.2222, 0.2222, 0.1111, 0.1111, 0.2222, 0.4444, 0.3333, 0.2222, 0.5556, 0.2222}, - degree_cenntrality_alg::AlgorithmType::kUndirected), + degree_centrality_alg::AlgorithmType::kUndirected), std::make_tuple(*mg_generate::BuildGraph(15, {{0, 4}, {0, 8}, {0, 13}, {1, 3}, {1, 8}, {1, 13}, {2, 8}, {2, 11}, {2, 13}, {3, 5}, {3, 8}, {3, 9}, {3, 11}, {3, 13}, {4, 7}, {4, 8}, {4, 11}, {5, 13}, {6, 7}, {6, 8}, {6, 9}, @@ -40,23 +40,23 @@ INSTANTIATE_TEST_SUITE_P( mg_graph::GraphType::kDirectedGraph), std::vector{0.2143, 0.2143, 0.2143, 0.4286, 0.2857, 0.1429, 0.2857, 0.2143, 0.5000, 0.1429, 0.1429, 0.2143, 0.0714, 0.6429, 0.1429}, - degree_cenntrality_alg::AlgorithmType::kUndirected))); + degree_centrality_alg::AlgorithmType::kUndirected))); INSTANTIATE_TEST_SUITE_P( InDegreeCentrality, DegreeCentralityTest, testing::Values( std::make_tuple(*mg_generate::BuildGraph(0, {}, mg_graph::GraphType::kDirectedGraph), std::vector{}, - degree_cenntrality_alg::AlgorithmType::kIn), + degree_centrality_alg::AlgorithmType::kIn), std::make_tuple( *mg_generate::BuildGraph(5, {{0, 4}, {1, 4}, {3, 0}, {3, 4}}, mg_graph::GraphType::kDirectedGraph), - std::vector{0.2500, 0.0000, 0.0000, 0.0000, 0.7500}, degree_cenntrality_alg::AlgorithmType::kIn), + std::vector{0.2500, 0.0000, 0.0000, 0.0000, 0.7500}, degree_centrality_alg::AlgorithmType::kIn), std::make_tuple(*mg_generate::BuildGraph(10, {{0, 4}, {0, 8}, {1, 4}, {1, 7}, {2, 3}, {2, 8}, {3, 6}, {3, 9}, {4, 1}, {4, 5}, {4, 8}, {4, 9}, {5, 1}, {5, 3}, {5, 8}, {5, 9}, {6, 2}, {7, 4}, {7, 6}, {7, 8}, {7, 9}, {8, 3}, {9, 2}, {9, 4}}, mg_graph::GraphType::kDirectedGraph), std::vector{0.0000, 0.2222, 0.2222, 0.3333, 0.4444, 0.1111, 0.2222, 0.1111, 0.5556, 0.4444}, - degree_cenntrality_alg::AlgorithmType::kIn), + degree_centrality_alg::AlgorithmType::kIn), std::make_tuple(*mg_generate::BuildGraph( 15, {{0, 4}, {0, 8}, {0, 13}, {1, 2}, {1, 7}, {1, 12}, {2, 5}, {2, 8}, {2, 10}, @@ -71,24 +71,24 @@ INSTANTIATE_TEST_SUITE_P( mg_graph::GraphType::kDirectedGraph), std::vector{0.2143, 0.5714, 0.3571, 0.2143, 0.3571, 0.5714, 0.4286, 0.2143, 0.3571, 0.2143, 0.4286, 0.2143, 0.3571, 0.5000, 0.4286}, - degree_cenntrality_alg::AlgorithmType::kIn))); + degree_centrality_alg::AlgorithmType::kIn))); INSTANTIATE_TEST_SUITE_P( OutDegreeCentrality, DegreeCentralityTest, testing::Values( std::make_tuple(*mg_generate::BuildGraph(0, {}, mg_graph::GraphType::kDirectedGraph), std::vector{}, - degree_cenntrality_alg::AlgorithmType::kOut), + degree_centrality_alg::AlgorithmType::kOut), std::make_tuple(*mg_generate::BuildGraph(5, {{0, 1}, {0, 4}, {2, 0}, {2, 1}, {3, 1}, {4, 0}, {4, 3}}, mg_graph::GraphType::kDirectedGraph), std::vector{0.5000, 0.0000, 0.5000, 0.2500, 0.5000}, - degree_cenntrality_alg::AlgorithmType::kOut), + degree_centrality_alg::AlgorithmType::kOut), std::make_tuple( *mg_generate::BuildGraph(10, {{0, 1}, {0, 4}, {0, 9}, {1, 0}, {1, 5}, {1, 8}, {2, 1}, {2, 3}, {2, 7}, {2, 9}, {3, 0}, {3, 4}, {3, 5}, {3, 6}, {3, 8}, {3, 9}, {4, 3}, {4, 7}, {6, 2}, {6, 3}, {6, 7}, {7, 9}, {8, 0}, {8, 5}, {9, 2}, {9, 7}}, mg_graph::GraphType::kDirectedGraph), std::vector{0.3333, 0.3333, 0.4444, 0.6667, 0.2222, 0.0000, 0.3333, 0.1111, 0.2222, 0.2222}, - degree_cenntrality_alg::AlgorithmType::kOut), + degree_centrality_alg::AlgorithmType::kOut), std::make_tuple(*mg_generate::BuildGraph( 15, {{0, 1}, {0, 4}, {0, 9}, {0, 10}, {0, 14}, {1, 3}, {1, 6}, {1, 7}, {1, 11}, {1, 13}, {1, 14}, {2, 3}, {2, 4}, {2, 5}, {2, 7}, {2, 8}, {2, 12}, {3, 0}, @@ -101,7 +101,7 @@ INSTANTIATE_TEST_SUITE_P( mg_graph::GraphType::kDirectedGraph), std::vector{0.3571, 0.4286, 0.4286, 0.0714, 0.2143, 0.2857, 0.1429, 0.1429, 0.5000, 0.4286, 0.5000, 0.2143, 0.3571, 0.2143, 0.3571}, - degree_cenntrality_alg::AlgorithmType::kOut) + degree_centrality_alg::AlgorithmType::kOut) )); diff --git a/cpp/node_similarity_module/algorithms/node_similarity.hpp b/cpp/node_similarity_module/algorithms/node_similarity.hpp index 0c8044ff9..26073a45d 100644 --- a/cpp/node_similarity_module/algorithms/node_similarity.hpp +++ b/cpp/node_similarity_module/algorithms/node_similarity.hpp @@ -119,7 +119,7 @@ std::set GetNeighbors(std::unordered_map> /* -Calculates similiraty between pairs of nodes given by src_nodes and dst_nodes. +Calculates similarity between pairs of nodes given by src_nodes and dst_nodes. */ std::vector> CalculateSimilarityPairwise(const mgp::List &src_nodes, const mgp::List &dst_nodes, node_similarity_util::Similarity similarity_mode, const std::string &property = "") { if (src_nodes.Size() != dst_nodes.Size()) { diff --git a/cpp/pagerank_module/algorithm/pagerank.cpp b/cpp/pagerank_module/algorithm/pagerank.cpp index a98eedf52..ee6cba448 100644 --- a/cpp/pagerank_module/algorithm/pagerank.cpp +++ b/cpp/pagerank_module/algorithm/pagerank.cpp @@ -30,7 +30,7 @@ class AdjacencyList { /// vector because the referenced vector could be resized (moved) which means /// that the reference is going to become invalid. /// - /// @return A reference to std::vector of adjecent node ids. + /// @return A reference to std::vector of adjacent node ids. const auto &GetAdjacentNodes(T node_id) const { return list_[node_id]; } private: diff --git a/cpp/pagerank_module/algorithm/pagerank.hpp b/cpp/pagerank_module/algorithm/pagerank.hpp index 1b4dd85c1..6e4b94a8c 100644 --- a/cpp/pagerank_module/algorithm/pagerank.hpp +++ b/cpp/pagerank_module/algorithm/pagerank.hpp @@ -36,10 +36,10 @@ class PageRankGraph { /// @return -- number of nodes in graph std::uint64_t GetNodeCount() const; - /// @return -- nubmer of edges in graph + /// @return -- number of edges in graph std::uint64_t GetEdgeCount() const; - /// @return -- a reference to ordered ordered vector of edges + /// @return -- a reference to ordered vector of edges const std::vector &GetOrderedEdges() const; /// Returns out degree of node node_id diff --git a/python/link_prediction.py b/python/link_prediction.py index 6c5010bd0..d87850a05 100644 --- a/python/link_prediction.py +++ b/python/link_prediction.py @@ -1134,7 +1134,7 @@ def raise_(ex): type_checker(checkpoint_freq, "checkpoint_freq must be an int. ", int) if checkpoint_freq <= 0: - raise Exception("Checkpoint frequency must be greter than 0. ") + raise Exception("Checkpoint frequency must be greater than 0. ") # aggregator check if Parameters.AGGREGATOR in parameters.keys(): diff --git a/python/mage/constraint_programming/vrp_cp_solver.py b/python/mage/constraint_programming/vrp_cp_solver.py index ea9cd737e..b97082cd7 100644 --- a/python/mage/constraint_programming/vrp_cp_solver.py +++ b/python/mage/constraint_programming/vrp_cp_solver.py @@ -171,12 +171,12 @@ def _add_constraints(self): constraint.apply_constraint() def _add_objective(self): - intermedias_sum = 0 + intermediate_sum = 0 for edge, variable in self._edge_chosen_vars.items(): duration = self.get_distance(edge) - intermedias_sum += self._model.Intermediate(duration * variable) + intermediate_sum += self._model.Intermediate(duration * variable) - self._model.Obj(intermedias_sum) + self._model.Obj(intermediate_sum) def _add_options(self): # The SOLVER option specifies the type of solver that solves the diff --git a/python/mage/link_prediction/predictors/MLPPredictor.py b/python/mage/link_prediction/predictors/MLPPredictor.py index ca6cd3216..70fd715e1 100644 --- a/python/mage/link_prediction/predictors/MLPPredictor.py +++ b/python/mage/link_prediction/predictors/MLPPredictor.py @@ -16,7 +16,7 @@ def apply_edges(self, edges: Tuple[torch.Tensor, torch.Tensor]) -> Dict: """Computes a scalar score for each edge of the given graph. Args: - edges (Tuple[torch.Tensor, torch.Tensor]): Has three members: ``src``, ``dst`` and ``data``, each of which is a dictionary representing the features of the source nodes, the destination nodes and the eedges themselves. + edges (Tuple[torch.Tensor, torch.Tensor]): Has three members: ``src``, ``dst`` and ``data``, each of which is a dictionary representing the features of the source nodes, the destination nodes and the edges themselves. Returns: Dict: A dictionary of new edge features """ diff --git a/python/mage/max_flow/bfs_weight_min_max.py b/python/mage/max_flow/bfs_weight_min_max.py index ca694204d..b58063cb9 100644 --- a/python/mage/max_flow/bfs_weight_min_max.py +++ b/python/mage/max_flow/bfs_weight_min_max.py @@ -8,7 +8,7 @@ def BFS_find_weight_min_max(start_v: mgp.Vertex, edge_property: str) -> mgp.Numb largest being used for capacity scaling, and smallest for lower bound :param start_v: starting vertex - :param edge_propery: str denoting the edge property used as weight + :param edge_property: str denoting the edge property used as weight :return: Number, the largest value of edge_property in graph """ diff --git a/python/mage/node2vec/second_order_random_walk.py b/python/mage/node2vec/second_order_random_walk.py index ea8c066d3..594113e53 100644 --- a/python/mage/node2vec/second_order_random_walk.py +++ b/python/mage/node2vec/second_order_random_walk.py @@ -30,7 +30,7 @@ def __init__(self, p: float, q: float, num_walks: int, walk_length: int): def sample_node_walks(self, graph: Graph) -> List[List[int]]: """ For each node we sample node walks for total of num_walks times - Total lenght of list would be approximately: num_walks * walk_length * num_nodes + Total length of list would be approximately: num_walks * walk_length * num_nodes Args: graph (Graph): Graph for which we want to sample walks diff --git a/python/mage/tgn/definitions/instances.py b/python/mage/tgn/definitions/instances.py index 953f34f68..bfca3c7f8 100644 --- a/python/mage/tgn/definitions/instances.py +++ b/python/mage/tgn/definitions/instances.py @@ -64,7 +64,7 @@ def forward( == len(edge_idxs) == len(edge_features) ), ( - f"Sources, destinations, negative sources, negative destinations, timestamps, edge_indxs and edge_features must be of same dimension, but got " + f"Sources, destinations, negative sources, negative destinations, timestamps, edge_indexes and edge_features must be of same dimension, but got " f"{sources.shape[0]}, {destinations.shape[0]}, {timestamps.shape[0]}, {len(edge_idxs)}, {len(edge_features)}" ) @@ -140,7 +140,7 @@ def forward( == len(edge_idxs) == len(edge_features) ), ( - f"Sources, destinations, timestamps, edge_indxs and edge_features must be of same dimension, but got " + f"Sources, destinations, timestamps, edge_indexes and edge_features must be of same dimension, but got " f"{sources.shape[0]}, {destinations.shape[0]}, {timestamps.shape[0]}, {len(edge_idxs)}, {len(edge_features)}" ) diff --git a/python/mage/tgn/definitions/layers.py b/python/mage/tgn/definitions/layers.py index 51e6a78a5..c6a211a15 100644 --- a/python/mage/tgn/definitions/layers.py +++ b/python/mage/tgn/definitions/layers.py @@ -255,7 +255,7 @@ def forward(self, data: GraphAttnDataType): ) # add third dimension, - # shape = (1, N, NUM_NEIGBORS * KEY_DIM) + # shape = (1, N, NUM_NEIGHBORS * KEY_DIM) aggregate_unsqueeze = torch.unsqueeze(aggregate, dim=0) curr_mapped_nodes = np.array([mapping[(v, t)] for (v, t) in nodes]) diff --git a/python/mage/tgn/definitions/tgn.py b/python/mage/tgn/definitions/tgn.py index f2f794876..a65622cf1 100644 --- a/python/mage/tgn/definitions/tgn.py +++ b/python/mage/tgn/definitions/tgn.py @@ -100,7 +100,7 @@ def __init__( MessageFunctionEdge = get_message_function_type(edge_message_function_type) # if edge function is identity, when identity function is applied, it will result with - # vector of greater dimension then when identity is applied to node raw messsage, so node function must be MLP + # vector of greater dimension then when identity is applied to node raw message, so node function must be MLP # if edge is MLP, node also will be MLP MessageFunctionNode = MessageFunctionMLP @@ -387,7 +387,7 @@ def _form_computation_graph( timestamp for which we will need to calculate embedding. We return all of this info as list of lists. At node_layers[0] there are all the nodes at fixed timestamp needed to calculate embeddings. mappings: List[Dict[Tuple[int, int], int]] - we build this list of dictionaries from node_layers. Every - (node,timestamp) tupple is mapped to index so we can reference it later in embedding calculation + (node,timestamp) tuple is mapped to index so we can reference it later in embedding calculation when building temporal neighborhood concatenated embeddings for graph_attn or for doing summation for graph_sum global_edge_indexes: List[List[int]] - node_layers[0] contains all nodes at fixed timestamp diff --git a/python/node_classification.py b/python/node_classification.py index 8f3b8e688..0f6628de9 100644 --- a/python/node_classification.py +++ b/python/node_classification.py @@ -310,7 +310,7 @@ def set_model_parameters( """The purpose of this function is to initialize all global variables. _You_ can change those via **params** dictionary. It checks if variables in **params** are defined appropriately. If so, - map of default global parameters is overriden with user defined dictionary params. + map of default global parameters is overridden with user defined dictionary params. After that it executes previously defined functions declare_globals and declare_model_and_data and sets each global variable to some value. diff --git a/python/nxalg.py b/python/nxalg.py index 44e14ded6..978db1daa 100644 --- a/python/nxalg.py +++ b/python/nxalg.py @@ -231,7 +231,7 @@ def strongly_connected_components( # networkx.algorithms.connectivity.edge_kcomponents.k_edge_components # -# NOTE: NetworkX 2.4, algorithms/connectivity/edge_kcompnents.py:367. We create +# NOTE: NetworkX 2.4, algorithms/connectivity/edge_kcomponents.py:367. We create # a *copy* of the graph because the algorithm copies the graph using # __class__() and tries to modify it. @mgp.read_proc @@ -384,7 +384,7 @@ def dominance_frontiers( ] -# networkx.algorithms.dominance.immediate_dominatorss +# networkx.algorithms.dominance.immediate_dominators @mgp.read_proc def immediate_dominators( ctx: mgp.ProcCtx, diff --git a/python/set_cover.py b/python/set_cover.py index 7697d3b2b..0ffe755a3 100644 --- a/python/set_cover.py +++ b/python/set_cover.py @@ -138,7 +138,7 @@ def create_matching_problem( self, element_vertexes: List[mgp.Vertex], set_vertexes: List[mgp.Vertex] ): """ - Creates a matching problem to be solved with gekko constraing programming method + Creates a matching problem to be solved with gekko constraint programming method :param element_vertexes: Element vertexes pair component list :param set_vertexes: Set vertexes pair component list :return: matching problem diff --git a/python/tests/graph_coloring/test_convergence_callback.py b/python/tests/graph_coloring/test_convergence_callback.py index 4b0b76259..4f395258c 100644 --- a/python/tests/graph_coloring/test_convergence_callback.py +++ b/python/tests/graph_coloring/test_convergence_callback.py @@ -34,7 +34,7 @@ def chain_population(graph): return population -def test_convergance_callback(graph, chain_population): +def test_convergence_callback(graph, chain_population): conv_callback = ConvergenceCallback() params = { Parameter.ERROR: ConflictError(), diff --git a/python/tgn.py b/python/tgn.py index 73db6e5e1..342dc93ce 100644 --- a/python/tgn.py +++ b/python/tgn.py @@ -1,6 +1,6 @@ """ This module represents entry point to temporal graph networks Python implementation of Temporal graph networks for -deep learning on dynamic graps paper https://arxiv.org/pdf/2006.10637.pdf introduced by E.Rossi [erossi@twitter.com] +deep learning on dynamic graphs paper https://arxiv.org/pdf/2006.10637.pdf introduced by E.Rossi [erossi@twitter.com] during his work in Twitter. Temporal graph networks(TGNs) is a graph neural network method on dynamic graphs. In the recent years, @@ -939,7 +939,7 @@ def train_and_eval( :train_eval_percent_split: dataset split ratio on train and eval - :return: mgp.Record(): emtpy record if everything was fine + :return: mgp.Record(): empty record if everything was fine """ global query_module_tgn @@ -1004,7 +1004,7 @@ def set_eval(ctx: mgp.ProcCtx) -> mgp.Record(message=str): At that point, we will save current edge count, and this information will later be used in function `train_and_eval` to split edges from Memgraph in train and eval set - :return: mgp.Record(): emtpy record if everything was fine + :return: mgp.Record(): empty record if everything was fine """ global query_module_tgn @@ -1057,12 +1057,12 @@ def get(ctx: mgp.ProcCtx) -> mgp.Record(node=mgp.Vertex, embedding=mgp.List[floa t1 and current timestamp can be tn, where t1 mgp.Record(): :param edges: list of edges to preprocess, and if current batch size is big enough use for training or evaluation - :return: mgp.Record(): emtpy record if everything was fine + :return: mgp.Record(): empty record if everything was fine """ global query_module_tgn_batch, query_module_tgn @@ -1195,7 +1195,7 @@ def set_params( [optional] edge_features_property: name of features property on edges from which we read features [optional] node_label_property: name of label property on nodes from which we read features - :return: mgp.Record(): emtpy record if everything was fine + :return: mgp.Record(): empty record if everything was fine """ global query_module_tgn_batch, DEFINED_INPUT_TYPES, DEFAULT_VALUES diff --git a/rust/rsmgp-sys/README.md b/rust/rsmgp-sys/README.md index f5e4732ea..b4354afdf 100644 --- a/rust/rsmgp-sys/README.md +++ b/rust/rsmgp-sys/README.md @@ -27,7 +27,7 @@ directly manipulated in the procedure call. The whole point of this library is to hide that complexity as much as possible. Memgraph Rust Query Modules API uses -[CStr](https://doc.rust-lang.org/std/ffi/struct.CStr.html) (`&CStr`) becuase +[CStr](https://doc.rust-lang.org/std/ffi/struct.CStr.html) (`&CStr`) because that's the most compatible type between Rust and Memgraph engine. [Rust String](https://doc.rust-lang.org/std/string/struct.String.html) can validly contain a null-byte in the middle of the string (0 is a valid Unicode diff --git a/rust/rsmgp-sys/mgp/mg_procedure.h b/rust/rsmgp-sys/mgp/mg_procedure.h index b1d4e323a..4139699b5 100644 --- a/rust/rsmgp-sys/mgp/mg_procedure.h +++ b/rust/rsmgp-sys/mgp/mg_procedure.h @@ -63,7 +63,7 @@ enum MGP_NODISCARD mgp_error { /// more efficient as explained before. ///@{ -/// Provides memory managament access and state. +/// Provides memory management access and state. struct mgp_memory; /// Allocate a block of memory with given size in bytes. @@ -1074,7 +1074,7 @@ enum mgp_error mgp_local_date_time_get_minute(struct mgp_local_date_time *local_ /// Get the second property of the local date-time. enum mgp_error mgp_local_date_time_get_second(struct mgp_local_date_time *local_date_time, int *second); -/// Get the milisecond property of the local date-time. +/// Get the millisecond property of the local date-time. enum mgp_error mgp_local_date_time_get_millisecond(struct mgp_local_date_time *local_date_time, int *millisecond); /// Get the microsecond property of the local date-time. diff --git a/rust/rsmgp-sys/src/property/mod.rs b/rust/rsmgp-sys/src/property/mod.rs index fbe147bb3..3d33630a6 100644 --- a/rust/rsmgp-sys/src/property/mod.rs +++ b/rust/rsmgp-sys/src/property/mod.rs @@ -29,7 +29,7 @@ use mockall_double::double; /// * return Property from [PropertiesIterator] /// * return Property directly from [crate::vertex::Vertex] or [crate::edge::Edge]. /// -/// Property owns [CString] and [Value] bacause the underlying C string or value could be deleted +/// Property owns [CString] and [Value] because the underlying C string or value could be deleted /// during the lifetime of the property. In other words, Property stores copies of underlying name /// and value. pub struct Property { diff --git a/rust/rsmgp-sys/src/result/mod.rs b/rust/rsmgp-sys/src/result/mod.rs index 740e22342..0245e143f 100644 --- a/rust/rsmgp-sys/src/result/mod.rs +++ b/rust/rsmgp-sys/src/result/mod.rs @@ -312,10 +312,10 @@ pub enum Error { #[snafu(display("Unable to return vertex out_edges iterator."))] UnableToReturnVertexOutEdgesIterator, - #[snafu(display("Unable to return vertex labels count becuase the vertex is deleted."))] + #[snafu(display("Unable to return vertex labels count because the vertex is deleted."))] UnableToReturnVertexLabelsCountDeletedObjectError, - #[snafu(display("Unable to return vertex labels count becuase the vertex is deleted."))] + #[snafu(display("Unable to return vertex labels count because the vertex is deleted."))] UnableToReturnVertexLabelDeletedObjectError, #[snafu(display("Unable to check if vertex has a label."))] diff --git a/rust/rsmgp-sys/src/rsmgp.rs b/rust/rsmgp-sys/src/rsmgp.rs index f5da120b0..6914beaf1 100644 --- a/rust/rsmgp-sys/src/rsmgp.rs +++ b/rust/rsmgp-sys/src/rsmgp.rs @@ -244,7 +244,7 @@ macro_rules! define_deprecated_type { NamedType { name: &c_str!($name), types: &[$($types),+], - depricated: true, + deprecated: true, } }; }