PHPackages                             selcukmart/number-of-connected-groups-y42 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. selcukmart/number-of-connected-groups-y42

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

selcukmart/number-of-connected-groups-y42
=========================================

1.0.0(4y ago)03MITPHP

Since Feb 17Pushed 4y ago2 watchersCompare

[ Source](https://github.com/selcukmart/NumberOfConnectedGroupsY42)[ Packagist](https://packagist.org/packages/selcukmart/number-of-connected-groups-y42)[ RSS](/packages/selcukmart-number-of-connected-groups-y42/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

```
composer require selcukmart/number-of-connected-groups-y42

```

### Number of connected groups

[](#number-of-connected-groups)

There are two solutions in it. One of them is non-recursive(custom distance calculation between coordinates technic) only iterable, the other is a classic solution called Depth First Search (DFS) .

The code has unit tests. It can be tested after cloned.

```
tests/CountForIterativeTest.php
tests/CountForRecursiveTest.php

```

Iterative Example;

```
$matrix = [
[1, 1, 1, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 1],
[1, 0, 0, 0, 0],
[1, 0, 1, 0, 1]
];

$result = (new NumberOfConnectedGroupsIterative(5, 5))->countGroups($matrix);
```

The result will be 5 for only horizontal and vertical links.

DFS Example

```
$matrix = [
            [1, 1, 0, 0, 0],
            [0, 1, 0, 0, 1],
            [1, 0, 0, 1, 1],
            [1, 0, 0, 0, 0],
            [1, 0, 1, 0, 1]
        ];

        $result = (new NumberOfConnectedGroupsRecursive(5, 5))->countGroups($matrix);
```

The result will be 5 for only horizontal and vertical links.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1545d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4ac9b4f7a2d8a39f741a8e6fd69e539f1bd66fdcff6a301a44f2a1c6f5e198c?d=identicon)[selcukmart](/maintainers/selcukmart)

---

Top Contributors

[![selcukmart](https://avatars.githubusercontent.com/u/8598667?v=4)](https://github.com/selcukmart "selcukmart (5 commits)")

---

Tags

Depth First SearchDFSconnected groupscalculation between coordinates

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/selcukmart-number-of-connected-groups-y42/health.svg)

```
[![Health](https://phpackages.com/badges/selcukmart-number-of-connected-groups-y42/health.svg)](https://phpackages.com/packages/selcukmart-number-of-connected-groups-y42)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
