---
name: "Graph::AdjacencyMap"
section: "3pm"
platform: "linux"
package: "libgraph-perl"
version: "1:0.9735-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Graph::AdjacencyMap"
---

# Graph::AdjacencyMap(3pm)

map of graph vertices or edges

## NAME

Graph::AdjacencyMap - map of graph vertices or edges

## SYNOPSIS

```
    Internal.
```

## DESCRIPTION

**This module is meant for internal use by the Graph module.**

## OBJECT METHODS

### del\_path(\\@seq)

Delete a Map path.

### del\_path\_by\_multi\_id(\\@seq, $id)

Delete a Map path by a multi(vertex) id.

### get\_multi\_ids(\\@seq)

Return the multi ids.

### has\_path(\\@seq)

Returns the integer ID of the path, or undef if Map doesn't have it.

### has\_any\_paths

Return true if the Map has any paths, false if not.

### has\_path\_by\_multi\_id(\\@seq, $id)

Return true if the Map has the path by a multi(vertex) id, false if not.

### paths

Return all the paths (left-hand sides) of the Map.

### ids

Return all the right-hand sides of the Map, unsorted.

### set\_paths(\\@seq1, \\@seq2, ...)

```
    @ids = set_paths($seq1, $seq2, ...)
```

Create/identify the path of `"$seq*"`. Returns the integer ID of each path. For arity other than 1, the sequence items must be integers. For arity 1, do not wrap the item in an array. For `"_UNORD"`, you must give the sequence already sorted.

### set\_path\_by\_multi\_id(\\@seq, $id)

```
    ($integer_ID, $multi_ID) = $m->set_path_by_multi_id(\@seq, $id)
```

Set the path in the Map by the multi id.

### get\_paths\_by\_ids(\[ \\@idlist1, \\@idlist2... \], $deep)

Given an array-ref of array-refs of vertex IDs, returns a list of array-refs of vertex-names. This is to look up vertex paths for use in edges. Only useful for arity 1. The `$deep` option is useful with directed hyperedges.

### get\_ids\_by\_paths

```
    @ids = $m->get_ids_by_paths([ \@seq1, \@seq2... ], $ensure, 0);
    @id_lists = $m->get_ids_by_paths([ \@seq1, \@seq2... ], $ensure, 1);
```

This is to look up vertex IDs for use in edges. Only useful for arity 1. Given an array-ref of array-refs with paths, returns a list of IDs of existing paths.

If `$ensure` is true, will first create paths that do not already exist. If it is not, any non-existing paths will cause an empty list to be returned.

If `$deep` is true, each sequence will be treated as a list of paths, and IDs filled in for the return values. This can have a value up to 2.

### rename\_path($from, $to)

Rename the path.

### stringify

Return a string describing the object in a human-friendly(ish) way.

### successors

```
    @successors = $m->successors(@v)
```

Only valid for a map of arity other than 1.

### predecessors

```
    @predecessors = $m->predecessors($v)
```

Only valid for a non-`"_UNORD"` map of arity other than 1.

### paths\_from

```
    @paths = $m->paths_from(@v)
```

Only valid for a map of arity other than 1.

### paths\_to

```
    @paths = $m->paths_to($v)
```

Only valid for a non-`"_UNORD"` map of arity other than 1.

### has\_successor

```
    $bool = $m->has_successor($u, $v)
```

Only valid for a map of arity other than 1.

### reindex

Will recreate the mapping from paths to indexes. Intended for use after a deep copy.

## AUTHOR AND COPYRIGHT

Jarkko Hietaniemi *jhi@iki.fi*

## LICENSE

This module is licensed under the same terms as Perl itself.
