Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Algoritmer og datastrukturer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jacob Theisen
Algoritmer og datastrukturer
Commits
3cb51c40
You need to sign in or sign up before continuing.
Commit
3cb51c40
authored
3 years ago
by
Jacob Theisen
Browse files
Options
Downloads
Patches
Plain Diff
føkk
parent
de38e5a2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+4
-0
4 additions, 0 deletions
.gitignore
ov9/program1.py
+5
-5
5 additions, 5 deletions
ov9/program1.py
with
9 additions
and
5 deletions
.gitignore
+
4
−
0
View file @
3cb51c40
...
...
@@ -3,6 +3,10 @@
/ov8/test_files/opg8-2021.pdf
/ov9/test_files/kanter.txt
/ov9/test_files/kanter.txt.1
/ov9/test_files/noder.txt
/ov9/test_files/noder.txt.1
/ov9/test_files/interessepkt.txt
/ov9/test_files/interessepkt.txt.1
This diff is collapsed.
Click to expand it.
ov9/program1.py
+
5
−
5
View file @
3cb51c40
...
...
@@ -32,7 +32,7 @@ class results(object):
#prep nodes
with
open
(
'
./test_files/noder.txt
'
,
'
r
'
)
as
file
:
with
open
(
'
./test_files/noder.txt
.1
'
,
'
r
'
)
as
file
:
node_file
=
file
.
read
()
node_file
=
node_file
.
split
()
...
...
@@ -45,7 +45,7 @@ for i in range(0, len(node_file), 3):
node_arr
.
append
(
nodes
(
int
(
node_file
[
i
]),
float
(
node_file
[
i
+
1
]),
float
(
node_file
[
i
+
2
])))
#prep edges
with
open
(
'
./test_files/kanter.txt
'
,
'
r
'
)
as
file
:
with
open
(
'
./test_files/kanter.txt
.1
'
,
'
r
'
)
as
file
:
edge_file
=
file
.
read
()
edge_file
=
edge_file
.
split
()
...
...
@@ -58,7 +58,7 @@ for i in range(0, len(edge_file), 5):
edge_arr
.
append
(
edges
(
int
(
edge_file
[
i
]),
int
(
edge_file
[
i
+
1
]),
int
(
edge_file
[
i
+
2
]),
int
(
edge_file
[
i
+
3
]),
int
(
edge_file
[
i
+
4
])))
#prep intresting
with
open
(
'
./test_files/interessepkt.txt
'
,
'
r
'
)
as
file
:
with
open
(
'
./test_files/interessepkt.txt
.1
'
,
'
r
'
)
as
file
:
intresting_file
=
file
.
read
()
intresting_file
=
intresting_file
.
split
(
'
\n
'
)
...
...
@@ -163,8 +163,8 @@ def init_things():
if
len
(
sys
.
argv
)
>
1
:
if
sys
.
argv
[
1
]
==
'
-d
'
:
#node_id
start
=
20
slutt
=
400
start
=
6368906
slutt
=
6789998
init_table
()
queue
.
put
(
0
)
start_node
=
next
(
a
for
a
in
res_arr
if
a
.
node
==
start
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment