.. index:: single: unweighted_directed_graph(Dictionary)
.. _unweighted_directed_graph/1:

.. rst-class:: right

**object**

``unweighted_directed_graph(Dictionary)``
=========================================

Unweighted directed graph predicates using a dictionary representation. The parametric object parameter is the dictionary to use for the graph representation.

| **Availability:** 
|    ``logtalk_load(graphs(loader))``

| **Author:** Paulo Moura
| **Version:** 1:0:0
| **Date:** 2026-02-20

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Imports:**
|    ``public`` :ref:`unweighted_graph_common(Dictionary) <unweighted_graph_common/1>`
|    ``public`` :ref:`directed_graph_common <directed_graph_common/0>`
| **Uses:**
|    :ref:`pairs <pairs/0>`
|    :ref:`set <set/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`unweighted_graph_protocol/0::add_edge/4`  :ref:`graph_protocol/0::add_edges/3`  :ref:`graph_protocol/0::add_vertex/3`  :ref:`graph_protocol/0::add_vertices/3`  :ref:`graph_protocol/0::all_pairs_min_paths/2`  :ref:`graph_protocol/0::all_pairs_min_predecessors/2`  :ref:`graph_protocol/0::breadth_first_order/3`  :ref:`unweighted_graph_protocol/0::complement/2`  :ref:`directed_graph_protocol/0::cycle/2`  :ref:`unweighted_graph_protocol/0::delete_edge/4`  :ref:`graph_protocol/0::delete_edges/3`  :ref:`graph_protocol/0::delete_vertex/3`  :ref:`graph_protocol/0::delete_vertices/3`  :ref:`graph_protocol/0::depth_first_order/3`  :ref:`unweighted_graph_protocol/0::edge/3`  :ref:`graph_protocol/0::edges/2`  :ref:`graph_protocol/0::empty/1`  :ref:`directed_graph_protocol/0::has_cycle/1`  :ref:`graph_protocol/0::has_path/3`  :ref:`directed_graph_protocol/0::in_degree/3`  :ref:`directed_graph_protocol/0::is_acyclic/1`  :ref:`graph_protocol/0::is_bipartite/1`  :ref:`graph_protocol/0::is_complete/1`  :ref:`graph_protocol/0::is_sparse/1`  :ref:`graph_protocol/0::max_path/5`  :ref:`graph_protocol/0::min_distances/3`  :ref:`graph_protocol/0::min_path/5`  :ref:`graph_protocol/0::min_predecessors/3`  :ref:`graph_protocol/0::neighbors/3`  :ref:`graph_protocol/0::new/1`  :ref:`graph_protocol/0::new/2`  :ref:`graph_protocol/0::new/3`  :ref:`graph_protocol/0::number_of_edges/2`  :ref:`graph_protocol/0::number_of_vertices/2`  :ref:`directed_graph_protocol/0::out_degree/3`  :ref:`graph_protocol/0::path/3`  :ref:`graph_protocol/0::reachable/3`  :ref:`directed_graph_protocol/0::strongly_connected_components/2`  :ref:`directed_graph_protocol/0::symmetric_closure/2`  :ref:`directed_graph_protocol/0::topological_sort/2`  :ref:`directed_graph_protocol/0::transitive_closure/2`  :ref:`directed_graph_protocol/0::transpose/2`  :ref:`graph_protocol/0::vertices/2`  :ref:`directed_graph_protocol/0::weakly_connected_components/2`  

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

.. index:: compose/3
.. _unweighted_directed_graph/1::compose/3:

``compose/3``
^^^^^^^^^^^^^

Composes ``NewGraph`` by connecting the drains of ``LeftGraph`` to the sources of ``RightGraph``.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``compose(LeftGraph,RightGraph,NewGraph)``
| **Mode and number of proofs:**
|    ``compose(+graph,+graph,-graph)`` - ``one``


------------

.. index:: union/3
.. _unweighted_directed_graph/1::union/3:

``union/3``
^^^^^^^^^^^

Unifies ``UnionGraph`` with the union of ``Graph1`` and ``Graph2``.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``union(Graph1,Graph2,UnionGraph)``
| **Mode and number of proofs:**
|    ``union(+graph,+graph,-graph)`` - ``one``


------------

.. index:: topological_sort/3
.. _unweighted_directed_graph/1::topological_sort/3:

``topological_sort/3``
^^^^^^^^^^^^^^^^^^^^^^

Difference list version of ``topological_sort/2`` where ``Sorted0`` is the tail of ``Sorted``.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``topological_sort(Graph,Sorted0,Sorted)``
| **Mode and number of proofs:**
|    ``topological_sort(+graph,+list(vertex),-list(vertex))`` - ``one``


------------

.. index:: leaves/2
.. _unweighted_directed_graph/1::leaves/2:

``leaves/2``
^^^^^^^^^^^^

Unifies ``Leaves`` with a sorted list of vertices with no outgoing edges.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``leaves(Graph,Leaves)``
| **Mode and number of proofs:**
|    ``leaves(+graph,-list(vertex))`` - ``one``


------------

.. index:: transitive_reduction/2
.. _unweighted_directed_graph/1::transitive_reduction/2:

``transitive_reduction/2``
^^^^^^^^^^^^^^^^^^^^^^^^^^

Computes the transitive reduction of the graph. An edge Vertex1-Vertex2 is in the reduction iff it is in the graph and there is no other path of length >= 2 from Vertex1 to Vertex2.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``transitive_reduction(Graph,Reduction)``
| **Mode and number of proofs:**
|    ``transitive_reduction(+graph,-graph)`` - ``one``


------------

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

