In this section, we formalize analogies using the category of colored directed multigraphs. We will first define the respective category and then show how some concepts central to the theory of analogies can be formalized using the CT concepts pullbacks and pushouts.
2.1. Category of Domains
We want to focus on the relational mapping between domains as a basis for finding and constructing analogies. Each domain consists of objects (e.g., sun and planets) and relations between these object (e.g., the Sun attracts a planet). A relation always has a direction (the Sun is bigger than a planet is not the same as a planet is bigger than the Sun) and each pair of objects can have multiple relations. As mentioned before, domains are modeled as directed multigraphs with loops. Colors are added to edges to show similarities between various edges. The attracts relations in
Figure 1 have, for example, more in common with each other than with the hotter relations. From here on, colored directed multigraphs will be just called colored graphs.
We now want to formally define a category
of colored graphs in order to better analyze the structure of maps between colored graphs. We expand the definition from
Section 1.2 to include colors. Each object in
is a colored graph that consists of three sets, the set of nodes
N, the set of edges
E, and the set of colors
C. In addition to the function mapping each edge to a source node (
) and a target node (
), there is one for color as well (
). Color is here not restricted to classic colors but can be seen as general labeling.
For example the graph for the atom in
Figure 1 can be formalized as object
in
with
nucleus, electron},
more massive, attracts, revolves around}, a set
of four distinct edges, and the respective maps
,
, and
to build the graph in the figure.
A category is defined not only by its objects, but also by its morphisms. A morphism
in our category
consists of three structure-preserving functions. The first,
, maps all edges from the base graph
B to edges of the target graph
T. The second map,
, maps all nodes from the base graph
B to nodes of the target graph
T in a way that preserves source and target nodes of the mapped edges. The third map,
, maps colors to colors, meaning that all edges that have the same color in the base graph must have the same color in the target graph. This may be a different color. This map makes the left square in
Figure 2 commute.
In our example of
Figure 1, there are many valid morphisms from the solar system graph
to the atom graph
. The two planets have to be mapped to a different node from the node sun, because there are no loops in
. The color ‘attracts’ is the only color with edges in all directions, so it can only be mapped to ‘attracts’ in
. However, there are not the same restrictions on morphisms for the other colors. Morphisms between sets can be easily composed, and each colored graph has an identity function, so
indeed fulfills all properties of a category.
So far we have encoded important structural information of domains in colored graphs and defined morphisms that preserve this structure. However, there can be many morphisms between two graphs, and not every morphism gives rise to a good analogy. There is also the additional concern that a morphism maps the whole graph. The ‘hotter’ edges in , for example, have no match in but will be mapped to some other edges by a morphism. We now want to use the concepts product and pullback to construct possible mappings between two domains that are more restricted but also allow a partial correspondence.
2.2. Pullbacks with Possible Analogies
The next concept we introduce is the product, which is a generalization of the Cartesian product of sets. A product of two objects in a category is another object in that category that contains all information of the two factors.
Figure 3a shows the product in a commutative diagram.
Definition 2 (Product). The product of two objects is equipped with two projection morphisms and such that for any object and pair of morphisms and there exists a unique morphism such that and .
A product is unique up to isomorphisms. The category contains for every pair of sets their Cartesian product and the respective projections, which fulfill the properties of the product defined above. So has all products. This is not necessarily true for every category.
A product of two colored graphs shows all possible mappings between the edges of the two graphs at once. For two colored graphs
for
, the product
has the node set
, edge set
, and a color set
isomorphic to
. The maps are defined as
for
. The projections
and
map each element of
,
, and
to their first or second component. See
Figure 4 for an example.
For the solar system example above, the product results in a large graph with many edges because any combination of edge mappings is considered. We will now define pullbacks and look at how a pullback over a simple graph can be used to force edges of certain colors to be only combined with other edges of these colors.
A pullback can be seen as a restricted product. The pullback in
over two morphisms
and
consists, for example, of the set
and the respective projections.
Figure 3b shows the following definition as a commutative diagram.
Definition 3 (Pullback). A pullback over two morphisms and is equipped with the morphisms and such that and for any other object and morphisms and with there exists a unique morphism such that and .
As mentioned above, a pullback can be used to restrict the product. This construction of seeing a product as all possibilities and using the pullback to sort by an inert structure has been used before in a paper on artificial perception [
14]. The pullback
over two morphisms
and
consists of the node set
, edge set
, a color set
, and the respective maps
s (for source nodes),
t (for target nodes), and
c (for colors).
The graph
G, which we call a middle graph here, is used to encode some prior information or restriction regarding the possible maps. For example,
Figure 5 shows a pullback for the graphs from
Figure 1 over a middle graph with a single node and one edge for each color that occurs in at least one of the two graphs. This graph and the morphisms
f and
g that map edges to edges of the same color encodes the prior knowledge that possible matches should only match edges of the same color with each other. For space reasons, the graphs of the solar system and the atom are shown at a smaller scale. For reference, we can compare this diagram to the one in
Figure 3b. The object
X is replaced by the graph describing the solar system and
Y by the graph describing the atom; the small graph has the same function as
M and the large graph is the pullback and therefore replaces
.
All possible analogies that adhere to the graph colors are superimposed in the pullback. The example pullback in
Figure 5 does not contain the hotter relation between the Sun and planets because there is no equivalent edge in the hydrogen atom. We can now look for each possible combination of pairing the nodes mars, venus, and sun with the the nodes electron and nucleus in the respective subgraph. There are six possible combinations of matches for injective mappings between the nodes of the two domains. Each match consists of one node of the graph
and one of
and a subgraph consists of two of these matches. The respective subgraph of the pullback contains all edges between these two node pairs.
Figure 6 shows the six resulting subgraphs. There are two subgraphs without any edges (a, b), two with only two edges (c, d), and two with four (e, f). The last two contain the most structure and are therefore the preferred mappings. These correspond to matching the Sun with the nucleus and one planet with the electron and are equally valid.
We could loosen the requirement on the color matching by changing the maps f and g. If edges of two colors are mapped to the same edge, all their combinations occur in the pullback. Another option is to force certain nodes or edges to be matched by adding edges and nodes to the middle graph. Hence, the pullback can be used to obtain a graph with all possible analogies superimposed based on prior knowledge. We can then reconstruct all possible matches and use the number of edges in the subgraphs as a preference order.
Figure 7 shows another pullback over a different graph. The middle graph now has three instead of one node and four edges with the same color black. This graph encodes different restrictions than the one in
Figure 5. Here, the nodes are already paired. The morphism
f maps the node mars to
m, sun to
s,n and venus to
v,e, respectively, while
g maps nucleus to
s,n and electron to
v,e. However, each edge is mapped to the one edge that has the correct source and target to fulfill the condition of a graph morphism without adhering to any color conditions because the middle graph does not encode any differentiation between colors. The resulting pullback contains only the two nodes
sun, nucleus and
venus, electron because the node
m was only matched by one of the two original graphs. However, because there was no differentiation between edge colors, each combination of two edges in
and
with the right source and target has a representation in the pullback graph.
In this example, the differentiation contained in the colors was lost in the maps to the uni-colored graph, resulting in many possible edges. In this case, it is more difficult to decide which edges should be used in a subgraph to describe the analogy.
2.3. Blending Using Pushouts
We can use a partial map from one domain to another to construct a new combined domain, the so-called conceptual blend. We build on the idea of using a pushout for this conceptual blending [
15,
16] to define the asymmetric transfer from the base domain to the target domain.
Many CT concepts have a dual in which the morphisms are reversed. The dual of a product is called a coproduct and is a generalization of a disjoint union of two sets.
Figure 8a shows the diagram describing a coproduct.
Definition 4 (Coproduct). The coproduct of two objects is equipped with two morphisms and such that for any object and pair of morphisms and there exists a unique morphism such that and .
In the category of multigraphs introduced above, a coproduct of two graphs is given by a disjoint union of these graphs and the morphisms mapping each graph to its respective subgraph. The dual of a pullback is called a pushout.
Definition 5 (Pushout). A pushout over two morphisms and is equipped with the morphisms and such that and for any other object and morphisms and with there exists a unique morphism such that and .
We have started by constructing a graph of possible analogies using the pullback, as shown in
Figure 5. The resulting subgraphs in
Figure 6 describe different analogies and can be used to create a blended graph via pushout. For the example in
Figure 9, the subgraph (f) in
Figure 6 was chosen because it is one of the subgraphs with the most edges. The resulting graph describing the blend contains this common graph and additionally all nodes and edges that occur in one of the two graphs, but not in the common graph.
The pushout over this graph matching sun to the nucleus and venus to the electron yields a graph with these two combined nodes and their combined edges and one additional node for Mars and some additional edges. This positioning of mars in the combined graph can be seen as the idea of having more than one revolving object in such a system and therefore having more than one electron in an atom. The hotter relation, which is also transferred, can lead to the realization that an explanation using this analogy has to point out this difference to avoid a wrong transfer or confusion.
Starting with a simple graph to match the colors of the two domain graphs, we constructed a pullback to find all possible matches for an analogy. One of these matches was chosen in the form of a subgraph of the pullback and used for a pushout to generate a blended graph.