1 | <?php |
||
18 | trait DegreeTrait |
||
19 | { |
||
20 | /** |
||
21 | * Gets the edges set. |
||
22 | * |
||
23 | * @return EdgeSet |
||
24 | */ |
||
25 | abstract public function getEdgeSet(): EdgeSet; |
||
26 | |||
27 | /** |
||
28 | * Gets the vertices set. |
||
29 | * |
||
30 | * @return VertexSet |
||
31 | */ |
||
32 | abstract public function getVertexSet(): VertexSet; |
||
33 | |||
34 | /** |
||
35 | * Gets vertex degree. |
||
36 | * |
||
37 | * @param VertexInterface $vertex |
||
38 | * |
||
39 | * @return int |
||
40 | */ |
||
41 | public function getVertexDegree(VertexInterface $vertex): int |
||
45 | |||
46 | /** |
||
47 | * Gets vertex in degree. |
||
48 | * |
||
49 | * @param VertexInterface $vertex |
||
50 | * |
||
51 | * @return int |
||
52 | */ |
||
53 | public function getVertexInDegree(VertexInterface $vertex): int |
||
63 | |||
64 | /** |
||
65 | * Gets vertex out degree. |
||
66 | * |
||
67 | * @param VertexInterface $vertex |
||
68 | * |
||
69 | * @return int |
||
70 | */ |
||
71 | public function getVertexOutDegree(VertexInterface $vertex): int |
||
81 | |||
82 | /** |
||
83 | * Gets maximum degree. |
||
84 | * |
||
85 | * @return int |
||
86 | */ |
||
87 | public function getMaxDegree(): int |
||
97 | |||
98 | /** |
||
99 | * Gets minimum degree. |
||
100 | * |
||
101 | * @return int |
||
102 | */ |
||
103 | public function getMinDegree(): int |
||
113 | |||
114 | /** |
||
115 | * Checks if vertex is isolated. |
||
116 | * |
||
117 | * @param VertexInterface $vertex |
||
118 | * |
||
119 | * @return bool |
||
120 | */ |
||
121 | public function isIsolatedVertex(VertexInterface $vertex): bool |
||
125 | |||
126 | /** |
||
127 | * Checks if vertex is a leaf. |
||
128 | * |
||
129 | * @param VertexInterface $vertex |
||
130 | * |
||
131 | * @return bool |
||
132 | */ |
||
133 | public function isLeafVertex(VertexInterface $vertex): bool |
||
137 | |||
138 | /** |
||
139 | * Checks if vertex is dominating. |
||
140 | * |
||
141 | * @param VertexInterface $vertex |
||
142 | * |
||
143 | * @return bool |
||
144 | */ |
||
145 | public function isDominatingVertex(VertexInterface $vertex): bool |
||
149 | } |
||
150 |