You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/graphs.jl
+53Lines changed: 53 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,59 @@ function Base.issubset(meta_graph::MetaGraph, h::MetaGraph)
47
47
returnissubset(meta_graph.graph, h.graph)
48
48
end
49
49
50
+
## List labels
51
+
52
+
"""
53
+
labels(meta_graph)
54
+
55
+
Iterate through all vertex labels, in the same order as the codes obtained by `vertices(meta_graph)`.
56
+
"""
57
+
functionlabels(meta_graph::MetaGraph)
58
+
return (label_for(meta_graph, code) for code invertices(meta_graph))
59
+
end
60
+
61
+
"""
62
+
edge_labels(meta_graph)
63
+
64
+
Iterate through all tuples of edge labels, in the same order as the tuples of codes obtained by `edges(meta_graph)`.
65
+
"""
66
+
functionedge_labels(meta_graph::MetaGraph)
67
+
return (
68
+
(label_for(meta_graph, src(ed)), label_for(meta_graph, dst(ed))) for
69
+
ed inedges(meta_graph)
70
+
)
71
+
end
72
+
73
+
"""
74
+
neighbor_labels(meta_graph, label)
75
+
76
+
Iterate through all labels of neighbors of the vertex `code` with label `label`, in the same order as the codes obtained by `neighbors(meta_graph, code)`.
return (label_for(meta_graph, code_2) for code_2 inneighbors(meta_graph, code_1))
81
+
end
82
+
83
+
"""
84
+
outneighbor_labels(meta_graph, label)
85
+
86
+
Iterate through all labels of outneighbors of the vertex `code` with label `label`, in the same order as the codes obtained by `outneighbors(meta_graph, code)`.
return (label_for(meta_graph, code_2) for code_2 inoutneighbors(meta_graph, code_1))
91
+
end
92
+
93
+
"""
94
+
inneighbor_labels(meta_graph, label)
95
+
96
+
Iterate through all labels of inneighbors of the vertex `code` with label `label`, in the same order as the codes obtained by `inneighbors(meta_graph, code)`.
# The functions `labels`, `edge_labels`, `(in/out)neighbor_labels` iterate through labels the same way that `vertices`, `edges` and `(in/out)neighbors` iterate through codes.
0 commit comments