---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/orchestration/plan/functions/immediateDominator.md
---

# Function: immediateDominator()

```ts
function immediateDominator(
  view: RawPlanView | PlanGraphView,
  entryId: string,
  nodeId: string,
): string | undefined;
```

Defined in: [src/batteries/orchestration/plan.ts:326](https://github.com/NHTIO/ADK/blob/v1.20260906.0/src/src/batteries/orchestration/plan.ts#L326)

The immediate dominator of a node, relative to an entry.

## Parameters

| Parameter | Type                                                                                                           | Description                                 |
| --------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| `view`    | | [`RawPlanView`](../../types/interfaces/RawPlanView.md) | [`PlanGraphView`](../interfaces/PlanGraphView.md) | The graph to search.                        |
| `entryId` | `string`                                                                                                       | The entry node id.                          |
| `nodeId`  | `string`                                                                                                       | The node whose immediate dominator to find. |

## Returns

`string` | `undefined`

The immediate dominator's id, or `undefined` when none exists.

## Remarks

The standard iterative dominator algorithm (Cooper–Harvey–Kennedy). A node `d` dominates `n`
when every path from `entryId` to `n` passes through `d`; the immediate dominator is the unique
strict dominator closest to `n`. A join's FORK is its immediate dominator — which is what makes
diamond joins decidable: the fork is known statically, so correlation and `required` are
computable at freeze.

Returns `undefined` when `nodeId` is the entry itself (a node does not dominate itself in the
immediate sense) or when `nodeId` is unreachable from `entryId` (no dominator exists).
