Graph:...encyMap(3pm)

✨ NAME ✨

Graph::AdjacencyMap β€” bestie, it's a map of graph vertices or edges πŸ’…


🌸 SYNOPSIS 🌸

Internal.

yeah that's it. that's the whole synopsis. it's giving mysterious. it's giving "you're not supposed to be here" πŸ’€


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so listen 🫢 this module is meant for internal use by the Graph module. Like, it's the backstage crew, the stagehands, the lighting techs of the whole Graph operation. You can poke at it but it's not for you, bestie, no cap.


πŸ‘‘ OBJECT METHODS πŸ‘‘

πŸ’– del_path(@seq)

Delete a Map path. gone. poof. bye bye πŸ‘‹

πŸ’– del_path_by_multi_id(@seq, $id)

Delete a Map path by a multi(vertex) id. same energy, different lookup key ✨

πŸ’– get_multi_ids(@seq)

Return the multi ids. all of them. the whole squad πŸŽ€

πŸ’– has_path(@seq)

Returns the integer ID of the path, or undef if Map doesn't have it. so like, if it's there you get a cute lil number, and if it's not you get undef which is basically the shrug emoji of Perl 🀷

πŸ’– has_any_paths

Return true if the Map has any paths, false if not. simple as. vibe check on the whole Map 🌈

πŸ’– has_path_by_multi_id(@seq, $id)

Return true if the Map has the path by a multi(vertex) id, false if not. yes/no, iconic behavior ⭐

πŸ’– paths

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

πŸ’– ids

Return all the right-hand sides of the Map, unsorted. key word: UNSORTED. do not come for me about the order, it did not promise you anything πŸ’…

πŸ’– set_paths(@seq1, @seq2, ...)

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

Create/identify the path of "$seq*". Returns the integer ID of each path.

Important lore: for arity other than 1, the sequence items must be integers. For arity 1, do not wrap the item in an array. And for "_UNORD", you must give the sequence already sorted β€” like, pre-sorted, you gotta do the work yourself, the module is not your personal assistant πŸ™ˆ

πŸ’– 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. two return values, double the slay πŸ’…βœ¨

πŸ’– 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 β€” hyperedges are giving main character energy fr fr πŸ‘‘

πŸ’– 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, it 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 β€” like, the whole thing just ghosts you 😭

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. yes, 2. that's the ceiling bestie, don't push it πŸŽ€

πŸ’– rename_path($from, $to)

Rename the path. glow-up complete ✨

πŸ’– stringify

Return a string describing the object in a human-friendly(ish) way. note the (ish). the module is being honest with you and I respect that 🫢

πŸ’– successors

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

Only valid for a map of arity other than 1. do not try this on arity 1, it will not go well πŸ’€

πŸ’– predecessors

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

Only valid for a non-"_UNORD" map of arity other than 1. so: not _UNORD, and not arity 1. two whole conditions. read them both πŸ™ˆ

πŸ’– paths_from

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

Only valid for a map of arity other than 1. same deal, arity 1 girlies sit this one out πŸ’…

πŸ’– paths_to

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

Only valid for a non-"_UNORD" map of arity other than 1. yes the _UNORD restriction again. it's consistent, okay, it's a whole thing 🌸

πŸ’– has_successor

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

Only valid for a map of arity other than 1. returns a bool, which is honestly the most chill thing in this whole doc πŸ’–

πŸ’– reindex

Will recreate the mapping from paths to indexes. Intended for use after a deep copy. like, deep copy leaves a mess, this is the cleanup crew 🧹✨


Jarkko Hietaniemi jhi@iki.fi

shoutout to Jarkko, absolute legend, we stan πŸ‘‘


🌈 LICENSE 🌈

This module is licensed under the same terms as Perl itself. periodt. πŸ’…


okay bestie that's the whole page πŸ’– this was perl v5.40.1, dated 2025-03-28, and it's the Graph:...encyMap(3pm) page from the User Contributed Perl Documentation. mwah, go read the actual Graph docs now, ily, bye βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from