Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
272 commits
Select commit Hold shift + click to select a range
47aec4a
Merge pull request #9 from spbu-coding-2023/create-algorithms-folders
suvorovrain May 9, 2024
9baa618
feat: delete redundant classes
suvorovrain May 9, 2024
cd35770
feat: add empty folders for secondary algorithms
suvorovrain May 9, 2024
76055cb
Merge remote-tracking branch 'origin/main'
n03d3n May 9, 2024
dd76094
feat: change classes signatures
n03d3n May 9, 2024
09b5da3
feat: change classes signatures
n03d3n May 9, 2024
652bc24
Merge pull request #10 from spbu-coding-2023/edge-class
n03d3n May 9, 2024
d1a8fc3
Merge remote-tracking branch 'origin/main'
n03d3n May 9, 2024
1963d3b
fix: change from a pair of vertices to a pair of id
n03d3n May 9, 2024
34b98eb
Merge branch 'refs/heads/edge-class' into Kruskal
n03d3n May 9, 2024
ad71848
Merge pull request #11 from spbu-coding-2023/edge-class
suvorovrain May 9, 2024
5e5f873
feat: add Kruskal algorithm implementation
n03d3n May 9, 2024
0c86c76
Merge remote-tracking branch 'origin/main' into Kruskal
n03d3n May 9, 2024
ea64e3e
Merge pull request #12 from spbu-coding-2023/Kruskal
n03d3n May 9, 2024
31f7f79
fix: fix visibility modifiers
suvorovrain May 9, 2024
55ef104
feat: create class for bridge finder algorithm
suvorovrain May 11, 2024
2f5e7f1
feat: implement raw version of bridge finder algorithm
suvorovrain May 11, 2024
6472677
feat: add todo for future work
suvorovrain May 11, 2024
97d34b4
Merge pull request #13 from spbu-coding-2023/bridge-finder
suvorovrain May 11, 2024
352f414
fix: add ID to edges and fix naming
suvorovrain May 12, 2024
ab3318c
fix: delete redundant interfaces
suvorovrain May 12, 2024
71cdfe1
feat(WIP): add Ford-Bellman algorithm class
suvorovrain May 12, 2024
ee3eb52
feat: raw implementation of Ford-Bellman algorithm
suvorovrain May 12, 2024
6c26a47
Merge pull request #14 from spbu-coding-2023/ford-bellman-algorithm
suvorovrain May 12, 2024
5c6253a
build: add dependencies for jetbrains exposed
suvorovrain May 12, 2024
04fd43b
feat: add examples dir
suvorovrain May 12, 2024
901ad44
feat: add databases directory
suvorovrain May 12, 2024
352606b
Merge pull request #15 from spbu-coding-2023/database-sql
suvorovrain May 12, 2024
bb4ce13
feet(graph): kosaraju algo skeleton added
Sem4kok May 12, 2024
57e7cce
feat(algo): kosaraju dfs added
Sem4kok May 12, 2024
799221c
feat(algo): kosaraju dfs test added
Sem4kok May 12, 2024
8882f9f
feat(test): kosaraju dfs test added
Sem4kok May 12, 2024
3bceb45
feat(test): kosaraju dfs test added
Sem4kok May 12, 2024
17f4749
feat(test): kosaraju dfs test added
Sem4kok May 12, 2024
f1a3f9d
feat(test): kosaraju dfs test added
Sem4kok May 12, 2024
f233822
feat(algo): kosaraju component dfs added
Sem4kok May 12, 2024
797aa78
feat(algo): kosaraju transpose graph added
Sem4kok May 12, 2024
2911671
feat(graph): kosaraju algorithm added
Sem4kok May 12, 2024
0c1d00d
refactor(algo): few algo refactor
Sem4kok May 12, 2024
c9394f5
refactor(algo): debugging fun deleted
Sem4kok May 12, 2024
bc6df29
feat(algo): kosaraju algo added
Sem4kok May 12, 2024
f90b459
fix: change generic type in graph model to string
suvorovrain May 13, 2024
56148fd
Merge pull request #17 from spbu-coding-2023/graph-model
suvorovrain May 13, 2024
dbc85b6
feat: add necessary folders for dao, start work on SQLiteFileHandler
suvorovrain May 13, 2024
49a9b98
feat: add dao objects
suvorovrain May 13, 2024
4d15fc8
feat: dao columns implemented
suvorovrain May 13, 2024
bba7f78
feat(ci): add mergeable.yml
n03d3n May 13, 2024
910dcd9
feat: implement dao rows
suvorovrain May 13, 2024
5f591ad
Merge pull request #18 from spbu-coding-2023/database-sql
suvorovrain May 14, 2024
cc6d4d9
feat: create blank classes for viewmodel
suvorovrain May 14, 2024
0f43416
feat: add viewmodel for graph
suvorovrain May 14, 2024
0b3f928
Merge pull request #19 from spbu-coding-2023/viewmodel
suvorovrain May 14, 2024
21179ce
feat: raw version of circular layout
suvorovrain May 14, 2024
4c0f611
feat: add canvas view model
suvorovrain May 14, 2024
43ec687
Merge pull request #20 from spbu-coding-2023/viewmodel-circularlayout
suvorovrain May 14, 2024
96138ce
Merge pull request #21 from spbu-coding-2023/viewmodel-canvas
suvorovrain May 14, 2024
7fcf000
feat: add classes for view
suvorovrain May 14, 2024
7e33bfc
fix: repair some bugs
suvorovrain May 14, 2024
cb36f93
feat: add view for canvas
suvorovrain May 15, 2024
8a863be
feat: add view for graph
suvorovrain May 15, 2024
b19c18f
feat: add demo graph
suvorovrain May 15, 2024
ea541fc
Merge pull request #23 from spbu-coding-2023/view
suvorovrain May 15, 2024
ca691e2
feat(ci): add ktfmt linter
n03d3n May 17, 2024
c97136a
feat(ci): add pre-commit hook
n03d3n May 17, 2024
77fb522
fix: reapair edge display
suvorovrain May 17, 2024
9636d39
fix(ci): remove approvals
suvorovrain May 18, 2024
5604f25
Merge pull request #24 from spbu-coding-2023/view
suvorovrain May 18, 2024
83a74e2
feat(algo): kosaraju algo returns component's
Sem4kok May 19, 2024
523d866
feat(algo): kosaraju algo returns component's
Sem4kok May 20, 2024
5669f93
feat(algo): djikstra algo skeleton added
Sem4kok May 20, 2024
f3cfd50
feat(algo): djikstra algo findPath's method added
Sem4kok May 20, 2024
7c230cd
feat(algo): djikstra algo reconstructPath method added
Sem4kok May 20, 2024
8128c41
feat(tests): djikstra test added
Sem4kok May 20, 2024
18de6c7
feat(tests): djikstra test added
Sem4kok May 20, 2024
0e43272
fix(algo): djikstra returns correct path
Sem4kok May 20, 2024
fb9729b
fix(algo): djikstra returns correct path
Sem4kok May 20, 2024
5ca6767
feat(tests): djikstra directed tests added
Sem4kok May 20, 2024
f5bea9e
feat(tests): djikstra directed tests added
Sem4kok May 20, 2024
39bb289
feat(tests): djikstra not directed tests added
Sem4kok May 20, 2024
f2a7cb9
feat(tests): djikstra not directed tests added
Sem4kok May 20, 2024
67d843c
feat(algo): djikstra compute empty-edged graph
Sem4kok May 20, 2024
1e438ba
fix(algo): djikstra extremal programming cases
Sem4kok May 20, 2024
e5006ce
feat(tests): djikstra extremal programming cases
Sem4kok May 20, 2024
f4e665d
Djikstra
Sem4kok May 20, 2024
d2ffbb1
feat(tests): kosaraju tests added
Sem4kok May 20, 2024
9b05128
feat(algo): kosaraju works with directed graphs
Sem4kok May 20, 2024
5312d71
Kosaraju
Sem4kok May 20, 2024
ff6ba7e
feat(db): Neo4jRepository class added
Sem4kok May 20, 2024
c227693
feat(db): Neo4jDBHandler added
Sem4kok May 20, 2024
88c6019
feat: removed vertices and edges labels parameters from graph view mo…
suvorovrain May 21, 2024
71d26bf
feat: add open function in sqlite database. correct some view model p…
suvorovrain May 21, 2024
661690d
feat: add example db for sqlite
suvorovrain May 21, 2024
007a3bb
Merge pull request #28 from spbu-coding-2023/database-sql
suvorovrain May 21, 2024
75ee9d1
fix(ci): comment approval task
suvorovrain May 21, 2024
f48c756
fix: repair canvas VM
suvorovrain May 21, 2024
7018e80
feat: add lables for vertices
suvorovrain May 21, 2024
33b8a16
Merge pull request #29 from spbu-coding-2023/gui
suvorovrain May 21, 2024
145ed07
feat: add multiple edges support
suvorovrain May 21, 2024
b26b23c
feat: blank files for bridge finder test
suvorovrain May 21, 2024
f57e033
fix: addVertex function now set id property to vertices
suvorovrain May 21, 2024
00b49c5
feat: add test for bridge finder algorithm
suvorovrain May 21, 2024
7e9af1c
Merge pull request #30 from spbu-coding-2023/bridge-finder-test
suvorovrain May 21, 2024
338ea81
fix: fix directories
suvorovrain May 21, 2024
4e61e99
fix: typos
suvorovrain May 21, 2024
c875dad
Merge pull request #31 from spbu-coding-2023/bridge-finder-test
suvorovrain May 21, 2024
325444d
test: add files for future tests for Ford Bellman algorithm
suvorovrain May 21, 2024
ac3a6e5
feat: add tests for Ford Bellman
suvorovrain May 22, 2024
eb34458
Merge pull request #32 from spbu-coding-2023/ford-bellman-algorithm-test
suvorovrain May 22, 2024
1aa982b
feat(db): Query fixed
Sem4kok May 22, 2024
553e05f
fix(db): Query vertex pull fixed
Sem4kok May 22, 2024
8e42f1c
fix(graph): graph method addV fixed
Sem4kok May 22, 2024
64ae406
feat(db): directed/n.directed edge could be added
Sem4kok May 22, 2024
fe6fb64
dep(): no logger impl added
Sem4kok May 22, 2024
b9367f8
dep(): gradle dep added
Sem4kok May 22, 2024
0807f48
merge(db): neo4j into main
Sem4kok May 22, 2024
52500b6
Neo4j
Sem4kok May 22, 2024
39f980a
feat(db): neo4j save/download graph
Sem4kok May 22, 2024
53eb630
feat(db): neo4j save/download graph
Sem4kok May 22, 2024
bb86544
fix(dep): graph import fixed
Sem4kok May 23, 2024
0519fb9
fix(dep): graph import fixed
Sem4kok May 23, 2024
b5efb90
feat(dep): lib impl. added
Sem4kok May 23, 2024
f1419c1
feat(algo): community finder class added
Sem4kok May 23, 2024
29b26ca
feat(algo): community finder class method added
Sem4kok May 23, 2024
af6592a
feat(algo): Kosaraju algo fixed
Sem4kok May 23, 2024
e464871
fix: correct imports
n03d3n May 24, 2024
b5778a8
feat(algo): Realtion class added
Sem4kok May 25, 2024
e2bd686
feat(algo): Neighbour class added
Sem4kok May 25, 2024
378b84d
fix(dep): dep fixed
Sem4kok May 25, 2024
d08c7a5
feat(algo): Louvain algo skeleton added
Sem4kok May 25, 2024
fea01fd
feat(algo): Louvain algo findCommunity method added
Sem4kok May 25, 2024
0b61b12
feat(algo): Louvain get neighbour method added
Sem4kok May 25, 2024
3cb3de4
feat(algo): Louvain class implementation
Sem4kok May 25, 2024
66047e5
Community finder
Sem4kok May 25, 2024
4f31131
feat(tests): Louvain test added
Sem4kok May 25, 2024
fcc59ef
feat(tests): Louvain test added
Sem4kok May 25, 2024
352e367
feat(tests): Louvain test added
Sem4kok May 25, 2024
b054541
feat(tests): Louvain test added
Sem4kok May 25, 2024
377e3ef
Community
Sem4kok May 25, 2024
5dcb009
feat(tests): Louvain test added
Sem4kok May 25, 2024
643d009
Community
Sem4kok May 25, 2024
d465ea9
feat(ui): graph painting by community
Sem4kok May 25, 2024
3280631
graph painting
Sem4kok May 25, 2024
5983166
feat(GUI): add navigation drawer
n03d3n May 26, 2024
2231e1e
feat(ci): uncomment approvals
suvorovrain May 26, 2024
0242052
feat(ui): graph painting by community
Sem4kok May 26, 2024
4baa908
feat(gradle): add material3 dependency
n03d3n May 27, 2024
50a3f80
feat(GUI): add algorithm sub menu raw version
n03d3n May 27, 2024
3f1a771
feat(GUI): update navigation drawer
n03d3n May 27, 2024
b49b25c
feat(GUI): make navigation drawer main Compose function
n03d3n May 27, 2024
508bf91
Merge pull request #39 from spbu-coding-2023/graphPaint
suvorovrain May 27, 2024
22118c5
feat(GUI): add raw menu
n03d3n May 27, 2024
2bd501b
Merge branch 'main' into gui
n03d3n May 27, 2024
01e9f1e
feat: update model
n03d3n May 28, 2024
f28c4ad
feat(algo): add Tarjan algorithm for finding strong connected component
n03d3n May 28, 2024
37e729f
Merge pull request #40 from spbu-coding-2023/gui
suvorovrain May 28, 2024
b53e8d0
Merge pull request #41 from spbu-coding-2023/ci
Sem4kok May 28, 2024
f25ce4a
fix: fix import paths
suvorovrain May 28, 2024
5418aee
fix: fix import paths
suvorovrain May 28, 2024
ad020fe
fix(algo): remove main function
n03d3n May 28, 2024
f8fc748
feat(algo): add Johnson's algorithm for finding cycles
n03d3n May 28, 2024
5f507a5
feat: implement ForceAtlas2
suvorovrain May 28, 2024
fcb59ee
fix: Delete redundant code
suvorovrain May 28, 2024
8b2e1cf
feat: implement ForceAtlas2
suvorovrain May 28, 2024
9d76ea1
fix(algo): remove some extra code and refactor
n03d3n May 29, 2024
cd2bba5
feat(GUI): add buttons for algorithms
n03d3n May 29, 2024
2c0b6f5
Merge pull request #42 from spbu-coding-2023/gui
suvorovrain May 29, 2024
f142891
feat: implement ForceAtlas2
suvorovrain May 28, 2024
9881f15
fix: Delete redundant code
suvorovrain May 28, 2024
e67396b
feat: implement ForceAtlas2
suvorovrain May 28, 2024
945df29
feat: add some files for graph load
suvorovrain May 29, 2024
ee74cd8
feat(ui): save_graph page added
Sem4kok May 29, 2024
79aaddb
feat: add load dialog window
suvorovrain May 29, 2024
4d140a7
Merge pull request #43 from spbu-coding-2023/layout
suvorovrain May 29, 2024
a4dfd6a
feat(ui): graph save neo4j implementation
Sem4kok May 29, 2024
a4ccec4
Merge pull request #44 from spbu-coding-2023/graph_save
Sem4kok May 29, 2024
e1dd046
feat(ui): graph save neo4j implementation
Sem4kok May 29, 2024
49b4512
feat(ui): graph save neo4j implementation
Sem4kok May 29, 2024
b8c9112
Merge pull request #45 from spbu-coding-2023/save_graph
suvorovrain May 29, 2024
90492cd
feat(ui): save_graph page added
Sem4kok May 29, 2024
8680e2e
feat(ui): graph save neo4j implementation
Sem4kok May 29, 2024
8bab653
feat(ui): graph save neo4j implementation
Sem4kok May 29, 2024
40ce39a
feat(ui): graph save neo4j implementation
Sem4kok May 29, 2024
be4da8f
feat: add some files for graph load
suvorovrain May 29, 2024
eb485d4
feat: add load dialog window
suvorovrain May 29, 2024
86e4a89
Merge branch 'main' into guirodion
suvorovrain May 29, 2024
3614905
Merge pull request #47 from spbu-coding-2023/guirodion
Sem4kok May 29, 2024
5af9b46
fix(ui): remove dublicate button
suvorovrain May 29, 2024
5c61c41
feat(ui): graph save neo4j implementation
Sem4kok May 29, 2024
f886d44
Merge pull request #48 from spbu-coding-2023/save_graph
suvorovrain May 29, 2024
2b22d1e
feat(visual): algorithm visualization added
Sem4kok May 29, 2024
eb90903
feat(visual): algorithm visualization for community added
Sem4kok May 29, 2024
840c90f
feat(visual): algorithm visualization for Kosaraju added
Sem4kok May 29, 2024
a65ef35
feat(visual): algorithm visualization for Djikstra added
Sem4kok May 29, 2024
e4040f2
feat(test): add tests for Kraskals algorithm
n03d3n May 29, 2024
fbead02
Merge branch 'refs/heads/main' into Kruskal
n03d3n May 29, 2024
2fab66a
feat(visual): algorithm visualization for Djikstra added
Sem4kok May 29, 2024
b84ad02
fix(test): correct imports
n03d3n May 29, 2024
862273c
feat(visual): algorithm visualization for Djikstra added
Sem4kok May 29, 2024
ecf4e8f
Merge pull request #50 from spbu-coding-2023/algoVisual
Sem4kok May 29, 2024
7d97961
Merge pull request #49 from spbu-coding-2023/Kruskal
n03d3n May 29, 2024
b8f09d2
feat(ui): add different types of storages support
suvorovrain May 29, 2024
349d975
Merge branch 'refs/heads/main' into find-cycles
n03d3n May 29, 2024
0ec8c63
fix(algo): remove main function from class
n03d3n May 29, 2024
452c717
Merge pull request #51 from spbu-coding-2023/gui-load-graph
suvorovrain May 29, 2024
fa65531
feat(databases): add work with CSV
n03d3n May 29, 2024
84ec7dd
Merge pull request #53 from spbu-coding-2023/CSV
suvorovrain May 29, 2024
c4008c2
feat:(ui) add ability to open SQlite db
suvorovrain May 29, 2024
14f9a66
feat(ui): add support for sqlite databases
suvorovrain May 29, 2024
4d3df97
Merge pull request #54 from spbu-coding-2023/gui-load-sqlite
suvorovrain May 29, 2024
3a00bca
Merge pull request #52 from spbu-coding-2023/find-cycles
n03d3n May 29, 2024
b45cb47
feat(db): load from neo4j added
Sem4kok May 29, 2024
69bdd34
Merge pull request #56 from spbu-coding-2023/load_Neo4j
suvorovrain May 29, 2024
17f38b0
feat(ui): implement raw version graph saving into sqlite databases
suvorovrain May 29, 2024
767b3f8
feat(ui): fixed colored graph loading bug
suvorovrain May 29, 2024
a17cb5f
fix: remove redundant prints
suvorovrain May 29, 2024
5e86285
Merge pull request #57 from spbu-coding-2023/gui-save-sqlite
suvorovrain May 29, 2024
a9b6277
fix: make gui more beauty
suvorovrain May 29, 2024
a130fa3
feat: add README
n03d3n May 29, 2024
abc0cd4
fix(CSV): correct header
n03d3n May 29, 2024
c349ae9
Delete README.md
suvorovrain May 29, 2024
738744e
feat: implement sad visualization of bridge finder algorithm
suvorovrain May 29, 2024
7e42405
Merge pull request #58 from spbu-coding-2023/bridge-algo-gui
suvorovrain May 29, 2024
eb1c199
feat: add readme [WIP]
suvorovrain May 29, 2024
6d66fba
Update README.md
suvorovrain May 29, 2024
52afe9b
feat: add small guide for SQL
suvorovrain May 29, 2024
87cb974
Update README.md
suvorovrain May 29, 2024
d9a4df8
fix: remove redundant buttons
suvorovrain May 29, 2024
0366d24
fix: remove redundant buttons
suvorovrain May 29, 2024
169d03f
fix: delete bad exceptions
suvorovrain May 30, 2024
a7bb01a
fix: format code
suvorovrain May 30, 2024
f6f6416
fix: format text
suvorovrain May 31, 2024
907660f
style: add spaces at the end of the file
Oct 24, 2024
d8b92e3
style: remove empty strings
Oct 24, 2024
ca681ac
docs(license): switch from MIT to GPL-V3
Oct 24, 2024
2a2bf4c
style: run ktfmtFormat
Oct 24, 2024
cfb3277
feat(algo): add reuse code and remove redundant Tarjan algo
Oct 25, 2024
8abe6a6
feat(layouts): add circular layout representation in Canvas
Oct 25, 2024
d6e17c5
style: run formatter
Oct 26, 2024
f476ce5
feat(UI): change cringe save file dialog to window
Oct 26, 2024
abc5ab1
feat(CSV): add save into CSV file
Oct 26, 2024
9cbc3c8
fead(UI): add Kruskal algo visualization
Oct 26, 2024
9c319f6
feat: add Cycles algo visualization
Oct 26, 2024
b5a5dad
style: formatter again
Oct 26, 2024
3847a86
feat(algo): implement Key Vertices Search visualization
Oct 26, 2024
6a65918
fix(Kruskal): add properly visualization for Kruskal algo
Oct 31, 2024
bf9c81e
fix(keyValues): add instant redrawing of graph
Oct 31, 2024
14cb448
fix: correct edges drawing
Oct 31, 2024
1fcda1b
feat(findCycles): add findCycles algo visualization
Oct 31, 2024
d8d6047
fix(tests): update tests after change weight Type
Oct 31, 2024
5a484c8
feat: release verison
Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: formatter
on: [push, pull_request]
jobs:
check-formatted:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Check formatter
run: ./gradlew ktfmtCheck

27 changes: 27 additions & 0 deletions .github/mergeable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2
mergeable:
- when: 'pull_request.*, pull_request_review.*'
name: Approvals check
filter:
# ignore 'Feedback' PR
- do: payload
pull_request:
title:
must_exclude:
regex: ^Feedback$
regex_flag: none
validate:
- do: description
no_empty:
enabled: true
message: 'Description matter and should not be empty. Provide detail with **what** was changed, **why** it was changed, and **how** it was changed.'
- do: approvals
min:
count: 1
block:
changes_requested: true
limit:
users:
- DronShock
- suvorovrain
- Sem4kok
41 changes: 22 additions & 19 deletions .run/desktop.run.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="desktop" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName"/>
<option name="externalProjectPath" value="$PROJECT_DIR$"/>
<option name="externalSystemIdString" value="GRADLE"/>
<option name="scriptParameters" value=""/>
<option name="taskDescriptions">
<list/>
</option>
<option name="taskNames">
<list>
<option value="run"/>
</list>
</option>
<option name="vmOptions" value=""/>
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<method v="2"/>
</configuration>
<configuration default="false" name="desktop" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--stacktrace" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="run" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
869 changes: 869 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

# ZeitNot - Graph Analyzer App
Это приложение позволяет выделять сообщества, находить ключевые вершины и делать раскладку направленных и ненаправленных, взвешенных и не взвешенных графов. Также поддерживается набор алгоритмов для анализа графа, в него входят алгоритм Форда-Беллмана, алгоритм Дейкстры и другие.
Приложение поддерживает сохранение в хранилища `SQL`, `CSV`, И `Neo4J`


## Установка и запуск
Приложение работает на Java SDK 21 версии.

- Установка:

```
git@github.com:spbu-coding-2023/graphs-graph-7.git
```
- Запуск:


#### Linux

```
./gradlew run
```

## Раскладка графа
Для раскладки графа используется алгоритм [ForceAtlas2](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0098679).


## SQLite
Приложение может читать два типа баз данных.
При этом сохраняются все базы данных во второй тип

1) Необработанный граф. Две таблицы -- на ребра и вершины графа


### Vertices

| id | data | community |
|--|--|--|
| *integer* | *text* | -1 |

`id` - уникальный идентификационный номер
`data` - информация, хранимая в вершине
`community` - информация о том, находится ли вершина в сообществе. Изначально равняется `-1`, после выполнения алгоритма кластеризации, равняется номеру сообщества
### Edges

| id | first | second | weight |
|--|--|--| -- |
| *integer* | *int* | *int* |*Long* |

`id` - уникальный идентификационный номер
`first` - **id** первой вершины, в случае направленного графа, считается началом ребра
`second` -**id** второй вершины, в случае направленного графа, считается концом ребра
`weight` - вес ребра. В случае не взвешенного графа, у всех ребер он равен единице

2. Обработанный граф. В таком случае должна быть третья таблица, а в таблице **Vertices** в поле **community** вместо -1 могут стоять непосредственно номера community

### _**VerticesView**_

| id| vertex | x | y| color |
|--|--|--|--|--|
| *integer* | *int* | *double*| *double*| *text*|

`id` - уникальный идентификационный номер

`vertex`- **id** вершины из таблицы **Vertices**

`x, y` - координаты вершины

`color` - цвет формата RGB в следующем виде "r:g:b", где r,g,b - float.

### Как открыть граф? (SQL)

Cохраненные графы находятся в `/saves/sqlite/`
Для загрузки базы данных из данной директории, выберите в меню загрузки формат SQL и укажите название графа. Для запуска примера напишите
```
Shelbiks.db
```

### Как сохранить граф? (SQL)
Сохранение происходит в меню сохранения. Достаточно выбрать формать SQL и указать название графа в формате `name.db`. Граф будет сохранен в `/saves/sqlite/`

---------
[WIP]
49 changes: 44 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,41 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
kotlin("jvm")
id("org.jetbrains.compose")
id("com.ncorti.ktfmt.gradle") version "0.18.0"
}

ktfmt {
// KotlinLang style - 4 space indentation - From kotlinlang.org/docs/coding-conventions.html
kotlinLangStyle()
}

group = "com.graph"
version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
maven("https://raw.github.com/gephi/gephi/mvn-thirdparty-repo/")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}

val exposedVersion: String by project
val neo4jDriverVersion = "4.4.5"
dependencies {
// Note, if you develop a library, you should use compose.desktop.common.
// compose.desktop.currentOs should be used in launcher-sourceSet
// (in a separate module for demo project and in testMain).
// With compose.desktop.common you will also lose @Preview functionality
implementation("org.gephi", "gephi-toolkit", "0.10.1", classifier = "all")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
implementation(compose.desktop.currentOs)
implementation(compose.material3)
implementation(compose.foundation)
implementation("org.slf4j:slf4j-nop:latest.release")
implementation("com.github.doyaaaaaken:kotlin-csv-jvm:0.15.2")
implementation("io.github.blackmo18:kotlin-grass-jvm:0.7.1")
implementation("org.neo4j.driver:neo4j-java-driver:$neo4jDriverVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
}

compose.desktop {
Expand All @@ -33,3 +51,24 @@ compose.desktop {
}
}
}

tasks.named<Test>("test") {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
tasks.withType<Test> {
testLogging {
events("PASSED", "SKIPPED", "FAILED")
}

tasks.register<Copy>("copyPreCommitHook") {
description = "Copy pre-commit git hook from the scripts to the .git/hooks folder."
group = "git hooks"
outputs.upToDateWhen { false }
from("$rootDir/scripts/pre-commit")
into("$rootDir/.git/hooks/")
}
tasks.build {
dependsOn("copyPreCommitHook")
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.9.22
compose.version=1.6.0
exposedVersion=0.50.1
44 changes: 44 additions & 0 deletions saves/csv/Example.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
isNode,name,id,x,y,color,radius,community,from,to,weight

true,13,Sniper,457.3282.dp,342.71585.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,14,Roshan,433.53894.dp,660.1613.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,7,Ryan,421.50995.dp,499.64575.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,12,Lion,725.70276.dp,1026.5232.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,5,Tristan,800.8322.dp,23.990685.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,10,Lycan,592.7067.dp,935.848.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,20,6,1498.49.dp,499.64575.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,17,3,1264.1929.dp,93.83106.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,11,Io,1040.4828.dp,1073.9686.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,15,1,960.0.dp,0.0.dp,0.53333336/0.53333336/0.53333336,25.0.dp,-1,,,
true,2,Andrew,1427.6537.dp,810.0.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,19,5,1462.6719.dp,342.71585.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,4,John,879.51715.dp,1073.9686.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,16,2,1119.1678.dp,23.990685.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,21,7,1486.461.dp,660.1613.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,1,Thomas,537.811.dp,203.3155.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,3,Iakov,1194.2972.dp,1026.5232.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,8,Pudge,492.34628.dp,810.0.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,18,4,1382.189.dp,203.3155.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,6,Arthur,1327.2933.dp,935.848.dp,0.0/0.0/0.0,25.0.dp,-1,,,
true,9,Tiny,655.8072.dp,93.83106.dp,0.0/0.0/0.0,25.0.dp,-1,,,
false,19,,,,,,,20,15,5.0
false,21,,,,,,,14,20,0.0
false,10,,,,,,,14,11,6.0
false,20,,,,,,,17,20,0.0
false,3,,,,,,,1,3,3.0
false,4,,,,,,,2,3,4.0
false,6,,,,,,,3,7,6.0
false,15,,,,,,,15,17,1.0
false,14,,,,,,,16,15,22.0
false,16,,,,,,,15,18,6.0
false,9,,,,,,,14,10,6.0
false,12,,,,,,,14,13,5.0
false,5,,,,,,,5,3,5.0
false,2,,,,,,,3,4,2.0
false,18,,,,,,,15,21,3.0
false,8,,,,,,,14,9,6.0
false,1,,,,,,,1,2,1.0
false,11,,,,,,,14,12,6.0
false,7,,,,,,,14,8,6.0
false,13,,,,,,,14,3,0.0
false,17,,,,,,,19,15,2.0
Binary file added saves/sqlite/Shelbiks.db
Binary file not shown.
14 changes: 14 additions & 0 deletions scripts/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

echo "> Task: ktfmtFormat"

./gradlew ktfmtFormat

echo "> Task: ktfmtCheck"

./gradlew --no-daemon ktfmtCheck

ktfmtCheckStatus=$?

[ $ktfmtCheckStatus -ne 0 ] && exit 1
exit 0
Loading