definiowanie
literal |
make_graph_from_literal(1-2-3, 1-3) |
- for an undirected edge, -+ for directed (+ is the arrowhead) |
adjacency matrix |
graph_from_adjacency_matrix(matrix_name, mode = "undirected") |
mode ="directed" or "undirected" |
edgelist |
gr1<-graph_from_edgelist(matrix_name, directed=FALSE) |
directed= "false" or "true" for a directed or non-directed graph |
atrybuty
list vertices |
V(graph_name) |
list edges |
E(graph_name) |
list degrees |
degree(graph_name) |
list degrees in oriented graph |
degree(graph_name, mode="in"/"out") |
files
saving into file |
write_graph(graph_name, "file_name.graphml", format = "graphml") |
miary centralności wierzchołków
stopień |
degree |
stopień ważony |
strength |
pośrednictwo |
betweenness |
bliskość |
closeness |
centralność wektora własnego |
eigen_centrality |
PageRank |
page_rank |
ekscentryczność |
eccentricity |
współczynnik klastrowania |
|
|
spójność
wyszukiwanie spójnych składowych |
components(graph_name, mode="weak") |
mode = "weak" or "strong" |
rysowanie
rysowanie w edytorze |
plot(graph_name) |
rysowanie ... |
tkplot(graphname |
drawing add-ons
edge.width = E(graph_name)$weight |
edge.label=E(graph_name)$weight |
edge.label.dist = 0.5 |
vertex.color="green" |
vertex.shape = "square" |
vertex.size=8 |
layout=layout_type(graph_name) |
layout_in_circle, layout_with_kk, layout_with_fr |
vertex.attribute_type |
vertex.color, vertex.shape, vertex.size |
edge_attr(graf1, "weight") <- c(2,2,1,5,1,4,3,2,3,6,4,1,2,1,5,3,2,3,1)
plot(graf1, edge.label = E(graf1)$weight)
|