Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Learning Python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Steinmann, Victor
Learning Python
Commits
fb59ea98
Commit
fb59ea98
authored
5 months ago
by
Steinmann
Browse files
Options
Downloads
Patches
Plain Diff
created loop to define Flow for each node and Edge
parent
4238e065
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
multiDiGraph.py
+10
-11
10 additions, 11 deletions
multiDiGraph.py
multiDiPath.ipynb
+12
-8
12 additions, 8 deletions
multiDiPath.ipynb
optimierung_pymoo.ipynb
+62
-74
62 additions, 74 deletions
optimierung_pymoo.ipynb
with
84 additions
and
93 deletions
multiDiGraph.py
+
10
−
11
View file @
fb59ea98
...
...
@@ -12,23 +12,22 @@ def construct_graph(*nodes):
else
:
continue
#erstelle einen Knoten für alle Übergebenen Knoten
edges
=
[]
we
=
[]
for
node
in
nodes
:
#für jeden String in den übergebenen Daten wird ein Knoten erstellt
if
isinstance
(
node
,
str
):
graph
.
add_node
(
node
)
#für jeden übergebenen touple der 2 knoten enthält wird eine Kante erstellt
elif
isinstance
(
node
,
tuple
)
and
len
(
node
)
==
2
:
if
isinstance
(
node
.
__getitem__
(
0
),
str
)
and
isinstance
(
node
.
__getitem__
(
1
),
str
):
graph
.
add_edge
(
node
.
__getitem__
(
0
),
node
.
__getitem__
(
1
))
else
:
print
(
'
Kante enthält unbekannten Knoten
'
)
else
:
print
(
'
Argument ist weder knoten noch Kante
'
)
edges
.
append
(
node
)
elif
isinstance
(
node
,
tuple
)
and
len
(
node
)
==
3
:
we
.
append
(
node
)
continue
pos
=
nx
.
spring_layout
(
graph
)
graph
.
add_edges_from
(
edges
)
graph
.
add_weighted_edges_from
(
we
)
pos
=
nx
.
shell_layout
(
graph
)
#berechnung der Knotengröße entsprechend der Beschriftungs argumente
nx
.
draw_networkx_nodes
(
graph
,
pos
,
node_size
=
sizeA
*
325
,
node_color
=
'
white
'
,
edgecolors
=
'
black
'
,
linewidths
=
1
)
...
...
This diff is collapsed.
Click to expand it.
multiDiPath.ipynb
+
12
−
8
View file @
fb59ea98
This diff is collapsed.
Click to expand it.
optimierung_pymoo.ipynb
+
62
−
74
View file @
fb59ea98
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
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