We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e57c502 commit 0c04cd4Copy full SHA for 0c04cd4
src/Property/GraphProperty.php
@@ -0,0 +1,33 @@
1
+<?php
2
+
3
+namespace Fhaculty\Graph\Algorithm\Property;
4
5
+use Fhaculty\Graph\Algorithm\BaseGraph;
6
7
+/**
8
+ * Simple algorithms for working with Graph properties
9
+ *
10
+ * @link https://en.wikipedia.org/wiki/Graph_property
11
+ */
12
+class GraphProperty extends BaseGraph
13
+{
14
+ /**
15
+ * checks whether this graph has no edges
16
17
+ * @return boolean
18
19
+ public function isEdgeless()
20
+ {
21
+ return !$this->graph->getEdges();
22
+ }
23
24
25
+ * checks whether this graph is trivial (one vertex and no edges)
26
27
28
29
+ public function isTrivial()
30
31
+ return (!$this->graph->getEdges() && $this->graph->getNumberOfVertices() === 1);
32
33
+}
0 commit comments