Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design2
/
2014104137
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
ghdms
2020-04-28 20:11:53 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0772d86489ffd27901a7e89500721f2b0d1de618
0772d864
1 parent
77f2de8e
중간보고서 제출
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
소스코드/movie_full.py
진행보고서/중간보고서.docx
소스코드/movie_full.py
View file @
0772d86
...
...
@@ -232,9 +232,12 @@ def named_union(graph1, graph2): #두 그래프 합성
Z
.
vs
[
"label"
]
=
Z
.
vs
[
"name"
][:]
return
Z
frequency
=
{}
weight
=
{}
keys
=
[]
top
=
data
[
"명량"
]
.
split
(
","
)
for
t
in
top
:
frequency
[
t
]
=
1
G
=
Graph
.
Full
(
len
(
top
))
G
.
vs
[
"name"
]
=
top
[:]
G
.
vs
[
"label"
]
=
G
.
vs
[
"name"
][:]
...
...
@@ -246,6 +249,11 @@ for movie in data:
g
.
vs
[
"name"
]
=
actors
[:]
g
.
vs
[
"label"
]
=
g
.
vs
[
"name"
][:]
G
=
named_union
(
G
,
g
)
for
a
in
actors
:
if
(
a
not
in
frequency
):
frequency
[
a
]
=
1
else
:
frequency
[
a
]
+=
1
for
i
in
range
(
0
,
len
(
actors
)
-
1
):
for
j
in
range
(
i
+
1
,
len
(
actors
)):
...
...
@@ -271,7 +279,10 @@ names, names1, names2 = G.vs["name"][:], G.vs["name"][:], G.vs["name"][:]
degree
=
G
.
degree
()
print
(
sorted
(
degree
,
reverse
=
True
)[:
10
])
print
(
sorted
(
names1
,
key
=
lambda
n
:
degree
[
names2
.
index
(
n
)],
reverse
=
True
)[:
10
])
topDegree
=
sorted
(
names1
,
key
=
lambda
n
:
degree
[
names2
.
index
(
n
)],
reverse
=
True
)[:
10
]
for
td
in
topDegree
:
print
(
td
+
"("
+
str
(
frequency
[
td
])
+
")"
)
print
(
"정인기("
+
str
(
frequency
[
"정인기"
])
+
")"
)
edge_weight
=
[
1
]
*
len
(
G
.
es
)
for
k
in
keys
:
...
...
@@ -291,6 +302,8 @@ cn = G.closeness(weights=edge_weight)
print
(
sorted
(
cn
,
reverse
=
True
)[:
10
])
print
(
sorted
(
names1
,
key
=
lambda
n
:
cn
[
names2
.
index
(
n
)],
reverse
=
True
)[:
10
])
print
(
len
(
G
.
vs
))
print
(
len
(
G
.
es
))
out
=
plot
(
G
,
bbox
=
(
2000
,
2000
),
vertex_size
=
[
int
((
float
(
i
)
/
max
(
bn
))
*
20
)
+
5
for
i
in
bn
],
...
...
진행보고서/중간보고서.docx
0 → 100644
View file @
0772d86
No preview for this file type
Please
register
or
login
to post a comment