Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implemented breadth-first-search. I implemented a function to compute all reachable nodes from a starting node via breadth-first-search. As it may be useful to also have the distances to the starting node (computing average-shortest-paths for example!) The new function returns a map with reachable nodes as keys and the distances to the starting point as values. * New functionality: Compute the connected components of an undirected graph. * Implemented k-cores The new functionality allows to compute the k-cores of a given graph. The k-cores of a graph g are the connected components of the maximal subgraph in which each node has at least k neighbours. * Created tests for k-cores * Implemented k-cores for contexts * Implemented tests for k-cores for contexts Implemented tests for the k-cores-functions of context-to-graph-projections. * Small cosmetics * Added average-shortest-path-via-bfs Added the functionality to compute the average shortest path length of a graph or context via breadth-first search. * Created tests for avg-shortest-path-via-bfs * Added functionality to compute clustering coefficients for graphs Conflicts: src/main/clojure/conexp/fca/applications/socialanalytics.clj * Created tests for clustering coefficients Conflicts: src/test/clojure/conexp/fca/applications/socialanalytics_test.clj * Implemented clustering-coefficient for bipartite graphs * Created tests for two-mode clustering Conflicts: src/test/clojure/conexp/fca/applications/socialanalytics_test.clj * Implemented betweenes-centrality * Implemented function ``close?`` to compare doubles If functions which operate with doubles are tested, it is possible that rounding errors occur and tests like (is (= a b)) will fail. For this reason I implemented a function ``close?`` that takes arguments x,y and epsilon and checks if |x-y| <= epsilon. * Added tests for betweenes-centrality * Added betweenes-centrality for contexts * Implemented tests for betweenes-centrality for contexts * Small cosmetics in tests * Restructuring I moved all stuff concerning basic graph structuring, such as breadth-first search or computing graphs from contexts into a seperated file ``structure``. * Overwrite of adjacency-matrices and average-shortest-path The new version stores the whole adjacency-matrix and works also for directed graphs. Using the whole matrix and not just the upper triangle makes the code much smaller but slows down the computation with factor 2 as a drawback. * Added needed dependencies * Restructured average-shortest-path * Formatting * Updated Contribution * close? -> near? --------- Co-authored-by: Maximilian Stubbemann <[email protected]> Co-authored-by: Maximilian Stubbemann <[email protected]> Co-authored-by: Tom Hanika <[email protected]>
- Loading branch information