Open
Conversation
* feat: add local git properties by gitignore and gitattributes files * feat: add simple information about project at ReadMe and LICENSE file * refactor: update gitignore file by ignoring IDE's files and folders and build projects result * feat: add basic gradle project * feat: add basic github actions yml scripts * refactor: add endline symbol for some files and rename mergeable script name * refactor: update main workflow script * refactor: update gradlew files mode to executable * fix: change regex to validate description of pull requests * fix: load template of mergeable yml-script from classroom
* feat: add application subproject Subproject implements 'Desktop Compose' library and contains template code of application * feat: add library 'graphs-lab' as subproject * feat: add 'detekt' linter as gradle plugin Add configuration as yml-script for linter and reformat 'main.kt' by adding endline symbol * refactor: update 'detekt' plugin implementation Update build.gradle.kts files at subprojects to load detekt-config.yml on it and append formatting rules on it. * feat: add simple 'graphs-lab' library implementation Add structure of core of 'graphs-lab' library. Add new classes: Vertex, Edge and WeightedEdge; and some implementations of Graph by weight property. * refactor: update CI Add dependence gradle task 'check' by 'detekt'. Setup run 'main' workflow action on push and PR on 'develop' branch.
…b.core' package Refactor Vertex class by removing 'open' modifier. Refactor WeightedEdge class by removing not valid method: 'equals', 'hashCode'.
Added properties: > 'idVertices' - all vertex's ID's set; > 'size' - count of vertices in the graph. Added method: > 'vertexEdges' - all edges where source is chosen vertex.
New workflow steps: > detekt task; > build sources; > run test; > display tests result; > generate jacoco tests reports; > display jacoco report.
Change 4 space to 1 tab symbol.
In WeightedEdge change weight property type from generic with Number implementation to Double.
* feat: add utility methods and data-structures Added utility method: 'edgeWeight(edge)' - for each type of edge can get weight. Added data-structures: 'Disjoint Sets', 'Priority Pair'. * docs: add documentation for utility * refactor: change method name, hash evaluation, init param Utility method's last name is 'edgeWeight', new name is 'getEdgeWeight'. Add dependency of class-name for hashCode method of PriorityPair. Update elements type of init parameter at DisjointSets class to Collection, throws exception if elements collection is empty. * tests: add tests for utilities Added tests for: 'PriorityPair', 'DisjointSets' data-structures and method from Utils.kt. * feat: add algs to find MST Added algorithms: Prim's and Kruskal's. * docs: add KDocs for MSTAlgorithms * test: add tests for algorithms to finding MST Added tests: * initializing MST algorithms; * 3 cases of graph type to run algorithms. Add test cases examples images by path: 'graph-lab/src/test/resources/examples/'. Add utils methods to tests. * refactor: update kruskal & prim algs to validate tests Remove unvisited vertices checking from kruskal's alg. Update expanding queue if it is empty in prim's alg. * docs: add KDocs test-utils and MST Method which get docs: * 'MSTAlgorithms::expandQueue'; * 'Utils.kt::assertEdgesCollection'; * 'Utils.kt::isValidEdgeCollection'. * refactor: update KDocs to remove '.' symbol * refactor: add explanation about comparison of double
* feat: implement Tarjan's strongly connected components algorithm * docs: add doc-strings for TarjanStrongConnectivityInspector * test: add tests for TarjanStrongConnectivityInspector * refactor: move indexOfScc to the class field Move indexOfScc to the class field so that it is not created every time sccUtil is called and the number of elements in the stack is not recalculated. * Change style of PR * feat: add reporting coverage and tests results on PR review * refactor: change place 'detekt' gradle plugin implementation * refactor: update code style by detekt rules * feat: change main CI github action by split it on two jobs * refactor: change TarjanStrongConnectivityInspector and TestTarjanStrongConnectivityInspector according to detekt`s requirements Put tabs instead of spaces, replace the if and throw with a require. * test: add new test to TestTarjanStrongConnectivityInspector * style: edit after the review Update code style by detekt rules, fix doc-strings and some chore. --------- Co-authored-by: Илья Супонев <90147482+IliaSuponeff@users.noreply.github.com>
* feat: add search graph's cycles algs * Change style of PR * feat: add reporting coverage and tests results on PR review * refactor: change place 'detekt' gradle plugin implementation * refactor: update code style by detekt rules * feat: change main CI github action by split it on two jobs * feat: add finding cycles alg for selected vertex * docs: add KDocs for CyclesSearchAlgorithms * test: add tests to find cycles Added tests for undirected graphs to find cycles. * test: add tests to find cycles Add tests for directed graphs to find cycles which start from chosen vertex and end on its. * test: add tests to find cycles Add tests for directed graphs to find cycles which start from chosen vertex and end on its. * refactor: update cycles search algs Add supporting directed graphs with smallest length. * docs: update CyclesSearchAlgorithms documentation * fix: invert condition for getting cycle length * refactor: update style of KDocs for CyclesSearchAlgorithms
* feat: implement Dijkstra algorithm * refactor: add a property and replace methods Add `statusTable` property for the correct interaction `getAllPaths` and `getPath` methods. Add `checkAndGet_` methods for avoiding usage `!!` and replace them in `Utils.kt`. * test: add tests for the Dijkstra algo and `Utils.kt` * style: rename file and some variables * docs: add doc-strings for the Dijkstra algo Add doc-strings for `DijkstraAlgorithm` and `checkAndGet_` in `Utils.kt`. * refactor: add the exception and the threshold in complexity Add the exception if `idTarget` is not contained in the graph and update doc-strings and tests in the such case. Set the threshold to 18 in compexity in CyclomaticComplexMethod. * refactor: amend the code after the review
* feat: implement Bellman–Ford algorithm * docs: add doc-strings for BellmanFordShortestPath * test: add tests for BellmanFordShortestPath * Change style of PR * feat: add reporting coverage and tests results on PR review * refactor: change place 'detekt' gradle plugin implementation * refactor: update code style by detekt rules * feat: change main CI github action by split it on two jobs * refactor: change BellmanFordShortestPath and TestBellmanFordShortestPath according to detekt`s requirements Put tabs instead of spaces, specify the type of exceptions, replace if and throw with a require. * refactor: BellmanFordShortestPath and TestBellmanFordShortestPath In the "getPath" function change the return value to a list, move the mapping an index to each vertex into a separate "vertexIndexing" function, add detection of negative cycles consisting of one vertex, edit the documentation and comments. * refactor: BellmanFordShortestPath and TestBellmanFordShortestPath The return value of the "getPath" function is changed to “null”, if there is no path between the vertices, and because of this, the return value of the entire function is changed to “List<I>?”. Remove unnecessary inheritance "I" from "Any". * test: add new tests BellmanFordShortestPath Add tests for undirected graph. --------- Co-authored-by: Илья Супонев <90147482+IliaSuponeff@users.noreply.github.com>
* feat: implement the Tarjan bridge finding algorithm * refactor: replace `checkAndGet_` methods and slightly change the style Delete `checkAndGet_` methods and import `checkAndGet_` functions. Change `getBridges` return to `Set()`. Rename some variables. * test: add tests for the Tarjan bridge finding algo Also change tests for `checkAndGet_` according the new realization. Add `E` param to `TarjanBridgeFinding` class and fix the inccorect input graph. * docs: add doc-stings for the Tarjan algo * docs: add doc-stings for `removeAndReturn()` Also update the definition of `bridge`. * refactor: edit doc-strings and remove unused import Edit doc-strings and change some style in `TarjianBridgeFinding` class and remove unused import in `TestTarjianBridgeFinding` class.
Simplify and combine a reused code and place the common modifiers in separate variables.
Update files structure to: > utils/ - classes and methods with utilities for application; > models/ - classes with models for application and its components; > viewmodels/ - classes with runtime information of views and models; > views/ - UI view methods. This commit add 10 TODO commentaries.
Now 'detekt' task run for all subprojects and support JetpackCompose.
* feat: implement saving graph to SQLite * feat: implement loading graph to SQLite * refactor: change code according reviewer comments
Important need test SQLite on write/load operations.
* refactor: change the graph property id to label * refactor: remove mutable modifier when comparing * refactor: move 'VertexData' to the separate file * refactor: remove 'AllCenterPlacementStrategy()' * fix: uncorrect creation a vertex with string type
* fix: uncorrect work after horizontal scroll
* fix: function return value Change the return value of a function 'stronglyConnectedComponents' from MutableMap<Int, MutableSet<I>> to Map<Int, Set<I>>. * fix: bugs related to Neo4j db Add vertex radius loading. Change writeData() to readData() in a loadGraphFromNEO4J(). Fix Neo4j`s path selection. * style: add new tint colors * chore: remove unnecessary <p>
* fix: update Louvan method Add support of grahs which total weight equals 0. * docs: update KDocs for GraphModularityEvaluator Add doc-string for public property `module`.
esvault
reviewed
Jun 1, 2024
Collaborator
esvault
left a comment
There was a problem hiding this comment.
20 баллов за алгоритмы
19 баллов за все остальное
Comment on lines
5
to
10
| class VertexID(private val value: Any, val type: VertexIDType) { | ||
|
|
||
| fun valueToInt(): Int = value.toString().toInt() | ||
| fun valueToString(): String = value.toString() | ||
|
|
||
| override fun equals(other: Any?): Boolean { |
Collaborator
There was a problem hiding this comment.
В Kotlin можно пользоваться data классами, чтобы не определять дефолтные методы по типу equals, hashCode и toString
|
|
||
| import graphs_lab.core.graphs.WeightedGraph | ||
|
|
||
| class WeightedUnweightedGraph<I>( |
Collaborator
There was a problem hiding this comment.
Так взвешенный или невзвешенный?
* fix: LeaderRank algorithm Fix a bug where the algorithm runs endlessly if there are 0 edges in the graph. Add tests for this case. * test: update test for LeaderRank Update "create graph matrix of unweighted graph" test: add a check for working with edges that have negative weights. * refactor: change the display of buttons for available algorithms Display buttons only for those algorithms that are suitable for this type of graph. * fix: vertex colors changing incorrectly When switching to another vertex, the color of the previous one is restored. If a vertex is selected and the clustering algorithm is launched or the graph is reset to default, the color of the current vertex is displayed correctly.
* docs: update ReadMe * docs: insert a picture into the ReadMe * fix: invalid save/load of json file by invalid path * fix: validation of sqlite db file path * fix: change method to save color of vertices --------- Co-authored-by: Maxim Rodionov <rodionov.maxim05@gmail.com>
* docs: add KDocs for composable function on utils/Widgets.kt Change name of some widget to more valid by containing. Add KDocs for AlgorithmButton.kt on models/utils package. * refactor: change package name and add KDocs Change package from `utils.representation` to `utils.placement_strategy`. Add KDocs for CircularPlacementStrategy and RandomPlacementStrategy classes. Recode RandomPlacementStrategy to more effective code. * docs: add KDocs for database package * docs: add KDocs for models package * docs: add KDocs for viewmodels package * docs: add KDocs for views package * refactor: convert KDocs to one format style * fix: convert KDocs to one format style
* refactor: transform class 'VertexID' to data class * docs: change docs in 'SQLite.kt' to fit the general style * docs: add KDocs for 'GraphViewPage' * refactor: simplify the code and change docs in 'GraphViewPage'
* feat: activate `detekt` execution for subproject `application` * refactor: update code-style by `comments` rules of detekt linter Add full KDocs for public method and properties of all `application` subproject. * refactor: update code-style by `complexity` rules of detekt linter * refactor: update code-style by `exception` rules of detekt linter * refactor: update code-style by `formatting` rules of detekt linter * feat: implement saving and loading of settings parameters * fix: a bug in 'CircularPlacementStrategy' Fix a bug where one vertex is repainted gray after applying 'CircularPlacementStrategy' * refactor: update code-style by `formatting` rules of ktlint linter Change imports from `<package>.*` to single imports. Spacing formatting. * refactor: update code-style by `formatting` rules of ktlint linter Change imports from `<package>.*` to single imports. Spacing formatting. * refactor: update code-style by `naming` rules of detekt linter * feat: implement saving and loading the history of previously opened graphs * refactor: update code-style by `potential-bugs` and `style` rules of detekt linter * refactor: backup Main.kt package * docs: add doc-strings for application variable information * refactor: move everything related to loading customization parameters to 'SettingsModel' Also recover deleted lines of code after merging the "linter" branch into "config". * refactor: reformat after PR Update subproject `application` by linter rules. --------- Co-authored-by: Maxim Rodionov <rodionov.maxim05@gmail.com>
* feat: add dependency of directory to save graph for create graph dialog * feat: update file picker dialog of load graph * feat: change placement of 'history' ans 'settings' data * feat: add custom implementation of file pick dialog * feat: add JetTheme for custom dialogs * refactor: update code style by linter * feat: remove `mpfilepicker` implementation from gradle dependencies * refactor: change usage of locale datetime info * refactor: clear imports
* feat: add logging of database classes * feat: add logging of filedialogs widgets and SettingsModel and Main * feat: add logging of placement strategies * feat: add logging of custom widgets * feat: add logging of view-models classes * refactor: update code-style by linter rules * refactor: remove redundant println method * fix: remove duplicate logging of changing pages on main screen * feat & refactor: add logging on update app theme and update enum usage cases * feat: add logging on GraphViewPage
* feat: add depending on actual window size * feat: add logging on place method for PlacementStategy * docs: update KDocs for new features * refactor: change updating actual window size * feat: add saving and loading last usage window size * fix: update window state size init * refactor: clear unused imports
* refactor: change the drawing of vertices and arrows * refactor: clean 'ForceDirected' code * refactor: change the display and movement of vertices * fix: detekt's remarks
* feat: update project Change JetBrains Compose version from `1.5.10` to `1.6.2`. Add dependencies for testing compose UI by JUnit platform. * feat: add tests tags for UI components * feat: add compose test initializator * feat: add simple integration test * refactor: update code-style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to
mainsince the assignment started. Your teacher can see this too.Notes for teachers
Use this PR to leave feedback. Here are some tips:
mainsince the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.main. Click a commit to see specific changes.For more information about this pull request, read “Leaving assignment feedback in GitHub”.
Subscribed: @IliaSuponeff @RodionovMaxim05 @Friend-zva