# Class DirectedInteractionGraph

Directed graph implementation for agent interactions.

#### Implements

- InteractionGraph

- Defined in packages/nexus-agents/src/observability/interaction-graph.ts:27

##### Index

### Constructors

constructor

### Methods

addNode
addEdge
getNodes
getEdges
getOutgoingEdges
getIncomingEdges
getDegreeCentrality
getStronglyConnectedComponents
getEdgeCount
getNeighbors
getClusteringCoefficient
getStats
clear

## Constructors

### constructor

- new DirectedInteractionGraph(): DirectedInteractionGraph

  #### Returns DirectedInteractionGraph

## Methods

### addNode

- addNode(agentId: string): void

  Add a node (agent) to the graph.

  #### Parameters

  - agentId: string

  #### Returns void

  Implementation of InteractionGraph.addNode

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:35

### addEdge

- addEdge(edge: InteractionEdge): void

  Add an edge (interaction) to the graph.

  #### Parameters

  - edge: InteractionEdge

  #### Returns void

  Implementation of InteractionGraph.addEdge

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:45

### getNodes

- getNodes(): string[]

  Get all nodes in the graph.

  #### Returns string[]

  Implementation of InteractionGraph.getNodes

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:63

### getEdges

- getEdges(): InteractionEdge[]

  Get all edges in the graph.

  #### Returns InteractionEdge[]

  Implementation of InteractionGraph.getEdges

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:70

### getOutgoingEdges

- getOutgoingEdges(agentId: string): InteractionEdge[]

  Get edges from a specific agent.

  #### Parameters

  - agentId: string

  #### Returns InteractionEdge[]

  Implementation of InteractionGraph.getOutgoingEdges

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:81

### getIncomingEdges

- getIncomingEdges(agentId: string): InteractionEdge[]

  Get edges to a specific agent.

  #### Parameters

  - agentId: string

  #### Returns InteractionEdge[]

  Implementation of InteractionGraph.getIncomingEdges

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:88

### getDegreeCentrality

- getDegreeCentrality(): Map<string, number>

  Calculate degree centrality for all nodes. Returns normalized centrality (0-1).

  #### Returns Map<string, number>

  Implementation of InteractionGraph.getDegreeCentrality

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:96

### getStronglyConnectedComponents

- getStronglyConnectedComponents(): string[][]

  Find strongly connected components using Kosaraju's algorithm.

  #### Returns string[][]

  Implementation of InteractionGraph.getStronglyConnectedComponents

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:122

### getEdgeCount

- getEdgeCount(from: string, to: string): number

  Get edge count between two agents.

  #### Parameters

  - from: string
  - to: string

  #### Returns number

  Implementation of InteractionGraph.getEdgeCount

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:172

### getNeighbors

- getNeighbors(agentId: string): string[]

  Get unique interaction partners for an agent.

  #### Parameters

  - agentId: string

  #### Returns string[]

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:180

### getClusteringCoefficient

- getClusteringCoefficient(agentId: string): number

  Calculate clustering coefficient for a node. Measures how interconnected a node's neighbors are.

  #### Parameters

  - agentId: string

  #### Returns number

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:197

### getStats

- getStats(): GraphStats

  Get statistics about the graph.

  #### Returns GraphStats

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:219

### clear

- clear(): void

  Clear the graph.

  #### Returns void

  Implementation of InteractionGraph.clear

  - Defined in packages/nexus-agents/src/observability/interaction-graph.ts:250