Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace Graphp\Algorithms\MaximumMatching;
use Fhaculty\Graph\Exception\UnexpectedValueException;
use Fhaculty\Graph\Graph;
use Fhaculty\Graph\Set\Edges;
use Graphp\Algorithms\BaseGraph;
abstract class Base extends BaseGraph
{
/**
* Get the count of edges that are in the match
*
* @return int
* @throws UnexpectedValueException if graph is directed or is not bipartit
* @uses Base::getEdges()
*/
public function getNumberOfMatches()
{
return \count($this->getEdges());
}
/**
* create new resulting graph with only edges from maximum matching
*
* @return Graph
* @uses Base::getEdges()
* @uses Graph::createGraphCloneEdges()
*/
public function createGraph()
{
return $this->graph->createGraphCloneEdges($this->getEdges());
}
/**
* create new resulting graph with minimum-cost flow on edges
*
* @return Edges
*/
abstract public function getEdges();
}