File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,31 @@ class GraphProperty extends BaseGraph
14
14
/**
15
15
* checks whether this graph has no edges
16
16
*
17
+ * Also known as empty Graph. An empty Graph contains no edges, but can
18
+ * possibly contain any number of isolated vertices.
19
+ *
17
20
* @return boolean
18
21
*/
19
22
public function isEdgeless ()
20
23
{
21
24
return $ this ->graph ->getEdges ()->isEmpty ();
22
25
}
23
26
27
+ /**
28
+ * checks whether this graph is a null graph (no vertex - and thus no edges)
29
+ *
30
+ * Each Edge is incident to two Vertices, or in case of an loop Edge,
31
+ * incident to the same Vertex twice. As such an Edge can not exist when
32
+ * no Vertices exist. So if we check we have no Vertices, we can also be
33
+ * sure that no Edges exist either.
34
+ *
35
+ * @return boolean
36
+ */
37
+ public function isNull ()
38
+ {
39
+ return $ this ->graph ->getVertices ()->isEmpty ();
40
+ }
41
+
24
42
/**
25
43
* checks whether this graph is trivial (one vertex and no edges)
26
44
*
You can’t perform that action at this time.
0 commit comments