001/* Copyright (C) 2013 TU Dortmund
002 * This file is part of AutomataLib, http://www.automatalib.net/.
003 * 
004 * AutomataLib is free software; you can redistribute it and/or
005 * modify it under the terms of the GNU Lesser General Public
006 * License version 3.0 as published by the Free Software Foundation.
007 * 
008 * AutomataLib is distributed in the hope that it will be useful,
009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
011 * Lesser General Public License for more details.
012 * 
013 * You should have received a copy of the GNU Lesser General Public
014 * License along with AutomataLib; if not, see
015 * http://www.gnu.de/documents/lgpl.en.html.
016 */
017package net.automatalib.graphs;
018
019import java.util.Collection;
020
021import net.automatalib.commons.util.mappings.MutableMapping;
022
023/**
024 * Interface for an (indefinite) graph structure. A graph consists of nodes, each of which
025 * has outgoing edges connecting to other nodes. In an indefinite graph, the node set is not
026 * required to be finite.
027 * 
028 * @author Malte Isberner <malte.isberner@gmail.com>
029 *
030 * @param <N> node class.
031 * @param <E> edge class.
032 */
033public interface IndefiniteGraph<N, E> {
034        
035        /**
036         * Retrieves the outgoing edges of a given node.
037         * @param node the node.
038         * @return a {@link Collection} of all outgoing edges, or <code>null</code> if
039         * the node has no outgoing edges.
040         */
041        public Collection<E> getOutgoingEdges(N node);
042        
043        /**
044         * Retrieves, for a given edge, its target node.
045         * @param edge the edge.
046         * @return the target node of the given edge.
047         */
048        public N getTarget(E edge);
049        
050        
051        public <V> MutableMapping<N,V> createStaticNodeMapping();
052        public <V> MutableMapping<N,V> createDynamicNodeMapping();
053}