PHP Classes

File: examples/extras/science/maths/tmathgraphhandler/tmathgraphhandler.articulationpoints.php

Recommend this page to a friend!
  Packages of Christos Drogidis   Ascoos OS   examples/extras/science/maths/tmathgraphhandler/tmathgraphhandler.articulationpoints.php   Download  
File: examples/extras/science/maths/tmathgraphhandler/tmathgraphhandler.articulationpoints.php
Role: Example script
Content type: text/plain
Description: This example tests a graph where B is the only articulation point.
Class: Ascoos OS
A PHP Web 5.0 Kernel for decentralized web and IoT
Author: By
Last change:
Date: 1 month ago
Size: 2,133 bytes
 

Contents

Class file image Download
<?php
/*
dobu {
    file:id(`example-00002082`) {
        ascoos {
            logo {`
                  __ _ ___ ___ ___ ___ ___ ___ ___
                 / _' |/ / / __/ _ \ / _ \ / / / _ \ / /
                | (_| |\ \| (_| (_) | (_) |\ \ | (_) |\ \
                 \__,_|/__/ \___\___/ \___/ /__/ \___/ /__/
            `},
            name {`ASCOOS OS`},
            version {`1.0.0`}
        },
        example {
            class {`TMathGraphHandler`},
            methods {`articulationPoints()`},
            source {`extras/science/maths/tmathgraphhandler/tmathgraphhandler.articulationpoints.php`},
            category:langs {
                en {`Graph Mathematics`},
                el {`?????????? ??????????`}
            },
            subcategory:langs {
                en {`Critical Vertex Analysis`},
                el {`??????? ???????? ???????`}
            },
            summary:langs {
                en {`Demonstrates how articulationPoints() detects critical vertices.`},
                el {`??????? ??? ? articulationPoints() ????????? ???????? ???????.`}
            },
            desc:langs {
                en {`This example tests a graph where B is the only articulation point.`},
                el {`?? ?????????? ??????? ???? ????? ???? ? B ????? ?? ???????? ?????? ????????.`}
            },
            author {`Drogidis Christos`},
            since {`1.0.0`},
            sincePHP {`8.4.0`}
        }
    }
}
*/
declare(strict_types=1);

use
ASCOOS\OS\Kernel\Science\Maths\TMathGraphHandler;

$startTime = microtime(true);
$startMem = memory_get_usage();

$g = new TMathGraphHandler();

$graph = [
   
'A' => ['B'],
   
'B' => ['A', 'C', 'D'],
   
'C' => ['B'],
   
'D' => ['B']
];

echo
"<pre>";
echo
"=== articulationPoints() Example ===\n\n";

print_r($g->articulationPoints($graph));

echo
"</pre>";

$g->Free();
print_stats($startTime, $startMem);
?>