Files
upo-graphs/doc/berack96/lib/graph/Graph.html
Giacomo Bertolazzi ddc81330ab dsadasdasd
* added a method where you can get all the marks
* implemented and tested
* moved main
* changed README
* builded JavaDoc
* builded jar
2019-06-21 23:50:34 +02:00

1916 lines
103 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_144) on Fri Jun 21 23:35:55 CEST 2019 -->
<title>Graph</title>
<meta name="date" content="2019-06-21">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Graph";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6,"i19":6,"i20":6,"i21":6,"i22":6,"i23":6,"i24":6,"i25":6,"i26":6,"i27":17,"i28":6,"i29":6,"i30":6,"i31":6,"i32":6,"i33":6,"i34":6,"i35":6,"i36":6,"i37":6,"i38":6,"i39":17,"i40":17,"i41":6,"i42":6,"i43":6,"i44":6,"i45":6,"i46":6,"i47":6,"i48":6,"i49":6,"i50":6,"i51":6};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Graph.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../berack96/lib/graph/Vertex.html" title="class in berack96.lib.graph"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?berack96/lib/graph/Graph.html" target="_top">Frames</a></li>
<li><a href="Graph.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">berack96.lib.graph</div>
<h2 title="Interface Graph" class="title">Interface Graph&lt;V,W extends java.lang.Number&gt;</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - The Object that represent a vertex</dd>
<dd><code>W</code> - The Object that represent the edge (more specifically the weight of the edge)</dd>
</dl>
<dl>
<dt>All Superinterfaces:</dt>
<dd>java.lang.Iterable&lt;V&gt;</dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../berack96/lib/graph/impl/AdjGraph.html" title="class in berack96.lib.graph.impl">AdjGraph</a>, <a href="../../../berack96/lib/graph/impl/MapGraph.html" title="class in berack96.lib.graph.impl">MapGraph</a>, <a href="../../../berack96/lib/graph/impl/MatrixGraph.html" title="class in berack96.lib.graph.impl">MatrixGraph</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Graph&lt;V,W extends java.lang.Number&gt;</span>
extends java.lang.Iterable&lt;V&gt;</pre>
<div class="block">An interface for the graphs.<br>
This interface is used for the graphs with Directed edges.<br>
A directed edge between V1 and V2 is an edge that has V1 as source and V2 as destination.<br></div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Berack96</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static com.google.gson.Gson</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#GSON">GSON</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#NOT_CONNECTED">NOT_CONNECTED</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#NOT_DAG">NOT_DAG</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#PARAM_NULL">PARAM_NULL</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#VERTEX_NOT_CONTAINED">VERTEX_NOT_CONTAINED</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#addAllEdges-java.util.Collection-">addAllEdges</a></span>(java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&nbsp;edges)</code>
<div class="block">Add all the edges of the collection to the graph.<br>
If one of the two, or both vertices aren't contained in the graph, then the vertices will be added.<br>
Any null edges will be ignored.<br>
This method will overwrite any existing edge between the two vertex.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#addAllVertices-java.util.Collection-">addAllVertices</a></span>(java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;vertices)</code>
<div class="block">Add all the vertices contained in the collection to the graph.<br>
If a vertex is contained in the collection and in the graph is ignored and it will not be replaced.<br>
Null vertices will be ignored and they will not be added to the graph.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#addEdge-berack96.lib.graph.Edge-">addEdge</a></span>(<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;edge)</code>
<div class="block">Add an edge between the two vertex.<br>
The edge will be created from the vertex source of the edge and the vertex destination of it<br>
This method will overwrite any existing edge between the two vertex.<br>
If there was a previous edge then it is returned</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#addEdge-V-V-W-">addEdge</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;weight)</code>
<div class="block">Add an edge between the two vertex.<br>
The edge will be created from the vertex V1 and the vertex V2<br>
This method will overwrite any existing edge between the two vertex.<br>
If there was a previous edge then it is returned</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#addEdgeAndVertices-berack96.lib.graph.Edge-">addEdgeAndVertices</a></span>(<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;edge)</code>
<div class="block">This particular function add an edge to the graph.<br>
If one of the two, or both vertices of the edge aren't contained in the graph, then the vertices will be added.<br>
The edge will be created from the vertex source of the edge and the vertex destination of it<br>
This method will overwrite any existing edge between the two vertex.<br>
If there was a previous edge then it is returned</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#addEdgeAndVertices-V-V-W-">addEdgeAndVertices</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;weight)</code>
<div class="block">This particular function add an edge to the graph.<br>
If one of the two, or both vertices aren't contained in the graph, then the vertices will be added.<br>
The edge will be created from the vertex V1 and the vertex V2<br>
This method will overwrite any existing edge between the two vertex.<br>
If there was a previous edge then it is returned</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#addVertex-V-">addVertex</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Add the vertex to the graph.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#addVertexIfAbsent-V-">addVertexIfAbsent</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Add the specified vertex to the graph only if the graph doesn't contains it.<br>
The graph contains a vertex only if the method <a href="../../../berack96/lib/graph/Graph.html#contains-V-"><code>contains(Object)</code></a> returns true.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#contains-V-">contains</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Check if the vertex passed is contained in the graph or not.<br>
The vertex V1 is contained in the graph G, if and only if:<br>
exist V2 in G such that V2.equals(V1)</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#containsEdge-V-V-">containsEdge</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2)</code>
<div class="block">Check if the edge between the two vertex passed is contained in the graph or not.<br>
An edge between V1 and V2 is contained in the graph if and only if i can travel from V1 to V2.<br>
If one of the two vertices is not contained in the graph, then even the edge isn't</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#degree-V-">degree</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Tells the degree of a vertex.<br>
The degree of a vertex is the quantity of edges that have.<br>
Basically, it'll count how many edge it have.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#degreeIn-V-">degreeIn</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Tells the degree of all the edges that goes to this vertex.<br>
Basically, it'll count how many edge towards himself it have.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#degreeOut-V-">degreeOut</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Tells the degree of all the edges that goes form this vertex to others.<br>
Basically, it'll count how many edge towards any other vertex it have.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>java.util.Map&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,java.util.List&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#distance-V-">distance</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;source)</code>
<div class="block">Get the minimum path from the source vertex to all the possible reachable vertices.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>java.util.List&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#distance-V-V-">distance</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;source,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;destination)</code>
<div class="block">Get the minimum path from the source vertex to the destination vertex.<br>
If the source vertex can't reach the destination, then an exception is thrown.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#edges--">edges</a></span>()</code>
<div class="block">Get all the edges in the graph.<br>
If the graph doesn't contains edges, it'll return an empty collection.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#edgesOf-V-">edgesOf</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Retrieve all the edges of a particular vertex.<br>
Note: the edges that are returned are the one that goes IN this vertex AND the edges that goes OUT of it.<br>
Note2: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#getAncestors-V-">getAncestors</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Get all the vertices that have the vertex passed as their child.<br>
Basically is the opposite of <a href="../../../berack96/lib/graph/Graph.html#getChildren-V-"><code>getChildren(Object)</code></a><br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#getChildren-V-">getChildren</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Get all the vertices that are children of the vertex passed as parameter.<br>
The vertices V(0-N) that are 'children' of a vertex V1, are all the vertices that have an edge
where V1 is the source of that edge.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#getEdgesIn-V-">getEdgesIn</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Retrieve all the edges of a particular vertex.<br>
Note: the edges that are returned are the one that have this vertex as destination and another as source.<br>
Note2: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#getEdgesOut-V-">getEdgesOut</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Retrieve all the edges that goes OUT of a particular vertex.<br>
Note: the edges that are returned are the one that have this vertex as source and another one as destination.<br>
Note2: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#getMarkedWith-java.lang.Object-">getMarkedWith</a></span>(java.lang.Object&nbsp;mark)</code>
<div class="block">Get all the vertices that are marked with the specific mark passed.<br>
If there aren't vertices with that mark then it is returned an empty set.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>java.util.Collection&lt;java.lang.Object&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#getMarks-V-">getMarks</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Get all the marker of this vertex.<br>
If the vertex doesn't have any mark, then it will return an empty set.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Vertex.html" title="class in berack96.lib.graph">Vertex</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#getVertex-V-">getVertex</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Get an instance of the vertex linked with this graph.<br>
For more info see <a href="../../../berack96/lib/graph/Vertex.html" title="class in berack96.lib.graph"><code>Vertex</code></a></div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#getWeight-V-V-">getWeight</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2)</code>
<div class="block">Get the weight of the selected edge.<br>
If the edge doesn't exist, then null is returned</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#isCyclic--">isCyclic</a></span>()</code>
<div class="block">Tells if the graph has some cycle.<br>
A cycle is detected if visiting the graph G starting from V1 (that is any of the vertex of G),
the visit can return to V1 in any point.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#isDAG--">isDAG</a></span>()</code>
<div class="block">Tells if the graph has the property of DAG (Directed Acyclic Graph).<br>
A graph is a DAG only if absent of any cycle.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>static &lt;V,W extends java.lang.Number&gt;<br>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#load-berack96.lib.graph.Graph-java.lang.String-java.lang.Class-java.lang.Class-">load</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;V,W&gt;&nbsp;graph,
java.lang.String&nbsp;file,
java.lang.Class&lt;V&gt;&nbsp;classV,
java.lang.Class&lt;W&gt;&nbsp;classW)</code>
<div class="block">Load an already saved graph in an instance of a graph.</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#mark-V-java.lang.Object-">mark</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex,
java.lang.Object&nbsp;mark)</code>
<div class="block">Add to the specified vertex the mark passed.<br>
A vertex can have multiple marker.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>java.util.Collection&lt;java.lang.Object&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#marks--">marks</a></span>()</code>
<div class="block">Get all the marks of this graph.<br>
Specifically it will return a collection of marks where every mark<br>
as associated at least one vertex of the graph.<br>
If the graph doesn't have vertex marked then it is returned an empty collection.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#numberOfEdges--">numberOfEdges</a></span>()</code>
<div class="block">Tells how many edges are in the graph.</div>
</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#numberOfVertices--">numberOfVertices</a></span>()</code>
<div class="block">Tells how many vertices are in the graph.</div>
</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#removeAllEdge--">removeAllEdge</a></span>()</code>
<div class="block">Remove all the edges of the graph.<br>
After this method's call the graph will have only vertices, and no edge.</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#removeAllEdge-V-">removeAllEdge</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Remove all edges form a particular vertex of the graph.<br>
After this method's call the selected vertex will have 0 edges.<br>
It will be no longer possible to reach this vertex from any other vertex, and vice versa.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#removeAllInEdge-V-">removeAllInEdge</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Remove all the edges that goes in the vertex.<br>
After this method's call it will be no longer possible travel to this vertex.</div>
</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#removeAllOutEdge-V-">removeAllOutEdge</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Remove all the edges that start from this vertex.<br>
After this method's call it will be no longer possible travel to any vertex from this one.</div>
</td>
</tr>
<tr id="i36" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#removeAllVertex--">removeAllVertex</a></span>()</code>
<div class="block">Remove all the vertex contained in the graph.<br>
After this method's call the graph will be empty; no vertices nor edges.</div>
</td>
</tr>
<tr id="i37" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#removeEdge-V-V-">removeEdge</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2)</code>
<div class="block">Remove the edge between the two vertex.<br>
If the edge doesn't exist, then this call does nothing.<br>
After this method's call it will be no longer possible to travel from V1 to V2, nether from V2 to V1.</div>
</td>
</tr>
<tr id="i38" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#removeVertex-V-">removeVertex</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Remove the selected vertex from the graph.<br>
After this method's call the vertex will be no longer present in the graph, and nether all his edges.</div>
</td>
</tr>
<tr id="i39" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#save-berack96.lib.graph.Graph-java.lang.String-">save</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;?,?&gt;&nbsp;graph,
java.lang.String&nbsp;file)</code>
<div class="block">Save the Graph passed as input to a file inserted as parameter.<br>
The resulting file is a Json string representing all the graph.<br>
If the directory for getting through the file do not exist,<br>
then it is created.<br>
For now the marks are not included.</div>
</td>
</tr>
<tr id="i40" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#save-berack96.lib.graph.Graph-java.lang.String-java.lang.String-">save</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;?,?&gt;&nbsp;graph,
java.lang.String&nbsp;other,
java.lang.String&nbsp;file)</code>
<div class="block">Save the Graph passed as input to a file inserted as parameter.<br>
The resulting file is a Json string representing all the graph.<br>
If the directory for getting through the file do not exist,<br>
then it is created.<br>
For now the marks are not included.<br>
The additional parameter is used if you want to save other as well as the graph.</div>
</td>
</tr>
<tr id="i41" class="rowColor">
<td class="colFirst"><code>java.util.Collection&lt;java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#stronglyConnectedComponents--">stronglyConnectedComponents</a></span>()</code>
<div class="block">The strongly connected components or disconnected components of an arbitrary directed graph
form a partition into subgraphs that are themselves strongly connected.</div>
</td>
</tr>
<tr id="i42" class="altColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#subGraph-java.lang.Object...-">subGraph</a></span>(java.lang.Object...&nbsp;marker)</code>
<div class="block">Get a sub-graph of the current one with only the vertex marked with the selected markers.<br>
Each vertex will have all his edges, but only the ones with the destination marked with the same marker.<br>
If the marker is not specified or is null then the returning graph will have all the vertices that are not marked by any marker.<br>
If the graph doesn't contain any vertex with that marker then an empty graph is returned.</div>
</td>
</tr>
<tr id="i43" class="rowColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#subGraph-V-int-">subGraph</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;source,
int&nbsp;depth)</code>
<div class="block">Get a sub-graph of the current one based on the maximum depth that is given.<br>
If the depth is 1 then only the source and it's children will be in the sub-graph.<br>
If the depth is 2 then only the source, it's children and it's children of it's children will be in the sub-graph.<br>
And so on.<br>
Of course the sub-graph will contain the edges that link the vertices, but only the one selected.</div>
</td>
</tr>
<tr id="i44" class="altColor">
<td class="colFirst"><code>java.util.List&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#topologicalSort--">topologicalSort</a></span>()</code>
<div class="block">If the current graph is a DAG, it returns a topological sort of this graph.<br>
A topological ordering of a graph is a linear ordering of its vertices such that for
every directed edge (V1, V2) from vertex V1 to vertex V2, V2 comes before V1 in the ordering.</div>
</td>
</tr>
<tr id="i45" class="rowColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#transpose--">transpose</a></span>()</code>
<div class="block">This method will create a new Graph that is the transposed version of the original.<br>
At the end of this method the new graph will have all the edges inverted in orientation.<br>
Example: if the graph G contains (V1, V2, V3) as vertex, and (V1-&gt;V2, V3-&gt;V2) as edges,
the transpose graph G' will contain (V1, V2, V3) as vertex, and (V2-&gt;V1, V2-&gt;V3) as edges.</div>
</td>
</tr>
<tr id="i46" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#unMark-V-">unMark</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)</code>
<div class="block">Unmark the vertex selected.<br>
After this call the vertex will not have any marked object to himself.</div>
</td>
</tr>
<tr id="i47" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#unMark-V-java.lang.Object-">unMark</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex,
java.lang.Object&nbsp;mark)</code>
<div class="block">Remove the selected mark from the vertex.<br></div>
</td>
</tr>
<tr id="i48" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#unMarkAll--">unMarkAll</a></span>()</code>
<div class="block">Remove all the marker to all the vertex.<br>
After this call the <a href="../../../berack96/lib/graph/Graph.html#getMarks-V-"><code>getMarks(Object)</code></a> applied to any vertex will return an empty set</div>
</td>
</tr>
<tr id="i49" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#unMarkAll-java.lang.Object-">unMarkAll</a></span>(java.lang.Object&nbsp;mark)</code>
<div class="block">Remove the selected mark from all the vertices</div>
</td>
</tr>
<tr id="i50" class="altColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#vertices--">vertices</a></span>()</code>
<div class="block">Get all the vertices in the graph.<br>
If the graph doesn't contains vertices, it'll return an empty collection.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
</td>
</tr>
<tr id="i51" class="rowColor">
<td class="colFirst"><code><a href="../../../berack96/lib/graph/visit/impl/VisitInfo.html" title="class in berack96.lib.graph.visit.impl">VisitInfo</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../berack96/lib/graph/Graph.html#visit-V-berack96.lib.graph.visit.VisitStrategy-java.util.function.Consumer-">visit</a></span>(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;source,
<a href="../../../berack96/lib/graph/visit/VisitStrategy.html" title="interface in berack96.lib.graph.visit">VisitStrategy</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;strategy,
java.util.function.Consumer&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;visit)</code>
<div class="block">Visit the graph accordingly to the strategy that is passed.<br>
This method visit the graph from the source to all the vertex that are reachable form the source.<br>
Some strategy can accept a source vertex null, because they visit all the graph anyway.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Iterable">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.lang.Iterable</h3>
<code>forEach, iterator, spliterator</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="NOT_DAG">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NOT_DAG</h4>
<pre>static final&nbsp;java.lang.String NOT_DAG</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../constant-values.html#berack96.lib.graph.Graph.NOT_DAG">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="NOT_CONNECTED">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NOT_CONNECTED</h4>
<pre>static final&nbsp;java.lang.String NOT_CONNECTED</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../constant-values.html#berack96.lib.graph.Graph.NOT_CONNECTED">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="PARAM_NULL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PARAM_NULL</h4>
<pre>static final&nbsp;java.lang.String PARAM_NULL</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../constant-values.html#berack96.lib.graph.Graph.PARAM_NULL">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="VERTEX_NOT_CONTAINED">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>VERTEX_NOT_CONTAINED</h4>
<pre>static final&nbsp;java.lang.String VERTEX_NOT_CONTAINED</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../constant-values.html#berack96.lib.graph.Graph.VERTEX_NOT_CONTAINED">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="GSON">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>GSON</h4>
<pre>static final&nbsp;com.google.gson.Gson GSON</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="isCyclic--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isCyclic</h4>
<pre>boolean&nbsp;isCyclic()</pre>
<div class="block">Tells if the graph has some cycle.<br>
A cycle is detected if visiting the graph G starting from V1 (that is any of the vertex of G),
the visit can return to V1 in any point.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if has cycle, false otherwise</dd>
</dl>
</li>
</ul>
<a name="isDAG--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDAG</h4>
<pre>boolean&nbsp;isDAG()</pre>
<div class="block">Tells if the graph has the property of DAG (Directed Acyclic Graph).<br>
A graph is a DAG only if absent of any cycle. ( see <a href="../../../berack96/lib/graph/Graph.html#isCyclic--"><code>isCyclic()</code></a> )</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if is a DAG, false otherwise</dd>
</dl>
</li>
</ul>
<a name="contains-java.lang.Object-">
<!-- -->
</a><a name="contains-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>contains</h4>
<pre>boolean&nbsp;contains(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException</pre>
<div class="block">Check if the vertex passed is contained in the graph or not.<br>
The vertex V1 is contained in the graph G, if and only if:<br>
exist V2 in G such that V2.equals(V1)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex to check</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the vertex is contained, false otherwise</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
</dl>
</li>
</ul>
<a name="getVertex-java.lang.Object-">
<!-- -->
</a><a name="getVertex-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertex</h4>
<pre><a href="../../../berack96/lib/graph/Vertex.html" title="class in berack96.lib.graph">Vertex</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;getVertex(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Get an instance of the vertex linked with this graph.<br>
For more info see <a href="../../../berack96/lib/graph/Vertex.html" title="class in berack96.lib.graph"><code>Vertex</code></a></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a vertex</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="addVertex-java.lang.Object-">
<!-- -->
</a><a name="addVertex-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addVertex</h4>
<pre>void&nbsp;addVertex(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException</pre>
<div class="block">Add the vertex to the graph. If it's already in the graph it will be replaced.<br>
Of course the vertex added will have no edge to any other vertex nor form any other vertex.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex to add</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
</dl>
</li>
</ul>
<a name="addVertexIfAbsent-java.lang.Object-">
<!-- -->
</a><a name="addVertexIfAbsent-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addVertexIfAbsent</h4>
<pre>boolean&nbsp;addVertexIfAbsent(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException</pre>
<div class="block">Add the specified vertex to the graph only if the graph doesn't contains it.<br>
The graph contains a vertex only if the method <a href="../../../berack96/lib/graph/Graph.html#contains-V-"><code>contains(Object)</code></a> returns true.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex to add</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the vertex is added, false if the graph contains the vertex and therefore the new one is not added</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
</dl>
</li>
</ul>
<a name="addAllVertices-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addAllVertices</h4>
<pre>void&nbsp;addAllVertices(java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;vertices)
throws java.lang.NullPointerException</pre>
<div class="block">Add all the vertices contained in the collection to the graph.<br>
If a vertex is contained in the collection and in the graph is ignored and it will not be replaced.<br>
Null vertices will be ignored and they will not be added to the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertices</code> - a collection of the vertices to add</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the set is null</dd>
</dl>
</li>
</ul>
<a name="removeVertex-java.lang.Object-">
<!-- -->
</a><a name="removeVertex-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeVertex</h4>
<pre>void&nbsp;removeVertex(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Remove the selected vertex from the graph.<br>
After this method's call the vertex will be no longer present in the graph, and nether all his edges.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex to remove</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained</dd>
</dl>
</li>
</ul>
<a name="removeAllVertex--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAllVertex</h4>
<pre>void&nbsp;removeAllVertex()</pre>
<div class="block">Remove all the vertex contained in the graph.<br>
After this method's call the graph will be empty; no vertices nor edges.</div>
</li>
</ul>
<a name="marks--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>marks</h4>
<pre>java.util.Collection&lt;java.lang.Object&gt;&nbsp;marks()</pre>
<div class="block">Get all the marks of this graph.<br>
Specifically it will return a collection of marks where every mark<br>
as associated at least one vertex of the graph.<br>
If the graph doesn't have vertex marked then it is returned an empty collection.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a collection of marks</dd>
</dl>
</li>
</ul>
<a name="mark-java.lang.Object-java.lang.Object-">
<!-- -->
</a><a name="mark-V-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mark</h4>
<pre>void&nbsp;mark(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex,
java.lang.Object&nbsp;mark)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Add to the specified vertex the mark passed.<br>
A vertex can have multiple marker.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex to mark</dd>
<dd><code>mark</code> - the mark to add</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the param is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="unMark-java.lang.Object-java.lang.Object-">
<!-- -->
</a><a name="unMark-V-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unMark</h4>
<pre>void&nbsp;unMark(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex,
java.lang.Object&nbsp;mark)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Remove the selected mark from the vertex.<br></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex where remove the mark</dd>
<dd><code>mark</code> - the mark to remove</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if a param is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="unMark-java.lang.Object-">
<!-- -->
</a><a name="unMark-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unMark</h4>
<pre>void&nbsp;unMark(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Unmark the vertex selected.<br>
After this call the vertex will not have any marked object to himself.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="getMarkedWith-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMarkedWith</h4>
<pre>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;getMarkedWith(java.lang.Object&nbsp;mark)
throws java.lang.NullPointerException</pre>
<div class="block">Get all the vertices that are marked with the specific mark passed.<br>
If there aren't vertices with that mark then it is returned an empty set.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mark</code> - the mark</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>all the vertices that are marked with that specific mark</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the mark is null</dd>
</dl>
</li>
</ul>
<a name="getMarks-java.lang.Object-">
<!-- -->
</a><a name="getMarks-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMarks</h4>
<pre>java.util.Collection&lt;java.lang.Object&gt;&nbsp;getMarks(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Get all the marker of this vertex.<br>
If the vertex doesn't have any mark, then it will return an empty set.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the vertex</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>all the mark to the vertex or an empty collection if none</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="unMarkAll-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unMarkAll</h4>
<pre>void&nbsp;unMarkAll(java.lang.Object&nbsp;mark)
throws java.lang.NullPointerException</pre>
<div class="block">Remove the selected mark from all the vertices</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mark</code> - the mark to remove</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the mark is null</dd>
</dl>
</li>
</ul>
<a name="unMarkAll--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unMarkAll</h4>
<pre>void&nbsp;unMarkAll()</pre>
<div class="block">Remove all the marker to all the vertex.<br>
After this call the <a href="../../../berack96/lib/graph/Graph.html#getMarks-V-"><code>getMarks(Object)</code></a> applied to any vertex will return an empty set</div>
</li>
</ul>
<a name="addEdge-java.lang.Object-java.lang.Object-java.lang.Number-">
<!-- -->
</a><a name="addEdge-V-V-W-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addEdge</h4>
<pre><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;addEdge(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;weight)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Add an edge between the two vertex.<br>
The edge will be created from the vertex V1 and the vertex V2<br>
This method will overwrite any existing edge between the two vertex.<br>
If there was a previous edge then it is returned</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex1</code> - a vertex of the graph</dd>
<dd><code>vertex2</code> - a vertex of the graph</dd>
<dd><code>weight</code> - the weight of the edge</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>null or the previous weight of the edge if there was already one</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameter is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if one of the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="addEdge-berack96.lib.graph.Edge-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addEdge</h4>
<pre><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;addEdge(<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;edge)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Add an edge between the two vertex.<br>
The edge will be created from the vertex source of the edge and the vertex destination of it<br>
This method will overwrite any existing edge between the two vertex.<br>
If there was a previous edge then it is returned</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>edge</code> - the edge to add</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>null or the previous weight of the edge if there was already one</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameter is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if one of the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="addEdgeAndVertices-java.lang.Object-java.lang.Object-java.lang.Number-">
<!-- -->
</a><a name="addEdgeAndVertices-V-V-W-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addEdgeAndVertices</h4>
<pre><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;addEdgeAndVertices(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;weight)
throws java.lang.NullPointerException</pre>
<div class="block">This particular function add an edge to the graph.<br>
If one of the two, or both vertices aren't contained in the graph, then the vertices will be added.<br>
The edge will be created from the vertex V1 and the vertex V2<br>
This method will overwrite any existing edge between the two vertex.<br>
If there was a previous edge then it is returned</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex1</code> - a vertex of the graph</dd>
<dd><code>vertex2</code> - a vertex of the graph</dd>
<dd><code>weight</code> - the weight of the edge</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>null or the previous weight of the edge if there was already one</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameter is null</dd>
</dl>
</li>
</ul>
<a name="addEdgeAndVertices-berack96.lib.graph.Edge-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addEdgeAndVertices</h4>
<pre><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;addEdgeAndVertices(<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;edge)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">This particular function add an edge to the graph.<br>
If one of the two, or both vertices of the edge aren't contained in the graph, then the vertices will be added.<br>
The edge will be created from the vertex source of the edge and the vertex destination of it<br>
This method will overwrite any existing edge between the two vertex.<br>
If there was a previous edge then it is returned</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>edge</code> - the edge to add</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>null or the previous weight of the edge if there was already one</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameter is null</dd>
<dd><code>java.lang.IllegalArgumentException</code></dd>
</dl>
</li>
</ul>
<a name="addAllEdges-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addAllEdges</h4>
<pre>void&nbsp;addAllEdges(java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&nbsp;edges)
throws java.lang.NullPointerException</pre>
<div class="block">Add all the edges of the collection to the graph.<br>
If one of the two, or both vertices aren't contained in the graph, then the vertices will be added.<br>
Any null edges will be ignored.<br>
This method will overwrite any existing edge between the two vertex.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>edges</code> - the edges to add</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the set is null</dd>
</dl>
</li>
</ul>
<a name="getWeight-java.lang.Object-java.lang.Object-">
<!-- -->
</a><a name="getWeight-V-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWeight</h4>
<pre><a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&nbsp;getWeight(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Get the weight of the selected edge.<br>
If the edge doesn't exist, then null is returned</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex1</code> - a vertex of the graph</dd>
<dd><code>vertex2</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the weight previously set, or null if the edge doesn't exist</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameters is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if one of the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="removeEdge-java.lang.Object-java.lang.Object-">
<!-- -->
</a><a name="removeEdge-V-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeEdge</h4>
<pre>void&nbsp;removeEdge(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Remove the edge between the two vertex.<br>
If the edge doesn't exist, then this call does nothing.<br>
After this method's call it will be no longer possible to travel from V1 to V2, nether from V2 to V1.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex1</code> - a vertex of the graph</dd>
<dd><code>vertex2</code> - a vertex of the graph</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameters is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if one of the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="removeAllInEdge-java.lang.Object-">
<!-- -->
</a><a name="removeAllInEdge-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAllInEdge</h4>
<pre>void&nbsp;removeAllInEdge(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Remove all the edges that goes in the vertex.<br>
After this method's call it will be no longer possible travel to this vertex.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameters is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if one of the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="removeAllOutEdge-java.lang.Object-">
<!-- -->
</a><a name="removeAllOutEdge-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAllOutEdge</h4>
<pre>void&nbsp;removeAllOutEdge(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Remove all the edges that start from this vertex.<br>
After this method's call it will be no longer possible travel to any vertex from this one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameters is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if one of the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="removeAllEdge-java.lang.Object-">
<!-- -->
</a><a name="removeAllEdge-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAllEdge</h4>
<pre>void&nbsp;removeAllEdge(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Remove all edges form a particular vertex of the graph.<br>
After this method's call the selected vertex will have 0 edges.<br>
It will be no longer possible to reach this vertex from any other vertex, and vice versa.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if one of the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="removeAllEdge--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAllEdge</h4>
<pre>void&nbsp;removeAllEdge()</pre>
<div class="block">Remove all the edges of the graph.<br>
After this method's call the graph will have only vertices, and no edge.</div>
</li>
</ul>
<a name="containsEdge-java.lang.Object-java.lang.Object-">
<!-- -->
</a><a name="containsEdge-V-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>containsEdge</h4>
<pre>boolean&nbsp;containsEdge(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex1,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex2)
throws java.lang.NullPointerException</pre>
<div class="block">Check if the edge between the two vertex passed is contained in the graph or not.<br>
An edge between V1 and V2 is contained in the graph if and only if i can travel from V1 to V2.<br>
If one of the two vertices is not contained in the graph, then even the edge isn't</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex1</code> - a vertex of the graph</dd>
<dd><code>vertex2</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the edge is contained, false otherwise</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameters is null</dd>
</dl>
</li>
</ul>
<a name="vertices--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>vertices</h4>
<pre>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;vertices()</pre>
<div class="block">Get all the vertices in the graph.<br>
If the graph doesn't contains vertices, it'll return an empty collection.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array that include all the vertices</dd>
</dl>
</li>
</ul>
<a name="edges--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>edges</h4>
<pre>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&nbsp;edges()</pre>
<div class="block">Get all the edges in the graph.<br>
If the graph doesn't contains edges, it'll return an empty collection.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a collection that include all the edges</dd>
</dl>
</li>
</ul>
<a name="edgesOf-java.lang.Object-">
<!-- -->
</a><a name="edgesOf-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>edgesOf</h4>
<pre>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&nbsp;edgesOf(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Retrieve all the edges of a particular vertex.<br>
Note: the edges that are returned are the one that goes IN this vertex AND the edges that goes OUT of it.<br>
Note2: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a collection of edges</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="getEdgesIn-java.lang.Object-">
<!-- -->
</a><a name="getEdgesIn-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEdgesIn</h4>
<pre>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&nbsp;getEdgesIn(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Retrieve all the edges of a particular vertex.<br>
Note: the edges that are returned are the one that have this vertex as destination and another as source.<br>
Note2: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a collection of edges</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="getEdgesOut-java.lang.Object-">
<!-- -->
</a><a name="getEdgesOut-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEdgesOut</h4>
<pre>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&nbsp;getEdgesOut(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Retrieve all the edges that goes OUT of a particular vertex.<br>
Note: the edges that are returned are the one that have this vertex as source and another one as destination.<br>
Note2: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a collection of edges</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="getChildren-java.lang.Object-">
<!-- -->
</a><a name="getChildren-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getChildren</h4>
<pre>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;getChildren(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Get all the vertices that are children of the vertex passed as parameter.<br>
The vertices V(0-N) that are 'children' of a vertex V1, are all the vertices that have an edge
where V1 is the source of that edge.<br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - the source vertex</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of vertices</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="getAncestors-java.lang.Object-">
<!-- -->
</a><a name="getAncestors-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAncestors</h4>
<pre>java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;getAncestors(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Get all the vertices that have the vertex passed as their child.<br>
Basically is the opposite of <a href="../../../berack96/lib/graph/Graph.html#getChildren-V-"><code>getChildren(Object)</code></a><br>
Note: depending on the implementation, modifying the returned collection<br>
could affect the graph behavior and the changes could be reflected to the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of ancestors of the vertex</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameters is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if one of the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="degreeIn-java.lang.Object-">
<!-- -->
</a><a name="degreeIn-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>degreeIn</h4>
<pre>int&nbsp;degreeIn(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Tells the degree of all the edges that goes to this vertex.<br>
Basically, it'll count how many edge towards himself it have.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the in degree of the vertex</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="degreeOut-java.lang.Object-">
<!-- -->
</a><a name="degreeOut-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>degreeOut</h4>
<pre>int&nbsp;degreeOut(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Tells the degree of all the edges that goes form this vertex to others.<br>
Basically, it'll count how many edge towards any other vertex it have.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the out degree of the vertex</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="degree-java.lang.Object-">
<!-- -->
</a><a name="degree-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>degree</h4>
<pre>int&nbsp;degree(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;vertex)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Tells the degree of a vertex.<br>
The degree of a vertex is the quantity of edges that have.<br>
Basically, it'll count how many edge it have.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertex</code> - a vertex of the graph</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the degree of the vertex</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained in the graph</dd>
</dl>
</li>
</ul>
<a name="numberOfVertices--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>numberOfVertices</h4>
<pre>int&nbsp;numberOfVertices()</pre>
<div class="block">Tells how many vertices are in the graph.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of vertices</dd>
</dl>
</li>
</ul>
<a name="numberOfEdges--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>numberOfEdges</h4>
<pre>int&nbsp;numberOfEdges()</pre>
<div class="block">Tells how many edges are in the graph.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of edges</dd>
</dl>
</li>
</ul>
<a name="visit-java.lang.Object-berack96.lib.graph.visit.VisitStrategy-java.util.function.Consumer-">
<!-- -->
</a><a name="visit-V-berack96.lib.graph.visit.VisitStrategy-java.util.function.Consumer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>visit</h4>
<pre><a href="../../../berack96/lib/graph/visit/impl/VisitInfo.html" title="class in berack96.lib.graph.visit.impl">VisitInfo</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;visit(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;source,
<a href="../../../berack96/lib/graph/visit/VisitStrategy.html" title="interface in berack96.lib.graph.visit">VisitStrategy</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;strategy,
java.util.function.Consumer&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;visit)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Visit the graph accordingly to the strategy that is passed.<br>
This method visit the graph from the source to all the vertex that are reachable form the source.<br>
Some strategy can accept a source vertex null, because they visit all the graph anyway.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the source vertex of the visit</dd>
<dd><code>strategy</code> - the algorithm for visiting the graph</dd>
<dd><code>visit</code> - the function to apply at each vertex</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an info of the visit</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameter is null (except the consumer)</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not in the graph</dd>
</dl>
</li>
</ul>
<a name="transpose--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transpose</h4>
<pre><a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;transpose()</pre>
<div class="block">This method will create a new Graph that is the transposed version of the original.<br>
At the end of this method the new graph will have all the edges inverted in orientation.<br>
Example: if the graph G contains (V1, V2, V3) as vertex, and (V1-&gt;V2, V3-&gt;V2) as edges,
the transpose graph G' will contain (V1, V2, V3) as vertex, and (V2-&gt;V1, V2-&gt;V3) as edges.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a transposed graph of this instance</dd>
</dl>
</li>
</ul>
<a name="topologicalSort--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>topologicalSort</h4>
<pre>java.util.List&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&nbsp;topologicalSort()
throws java.lang.UnsupportedOperationException</pre>
<div class="block">If the current graph is a DAG, it returns a topological sort of this graph.<br>
A topological ordering of a graph is a linear ordering of its vertices such that for
every directed edge (V1, V2) from vertex V1 to vertex V2, V2 comes before V1 in the ordering.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array containing the topological order of the vertices</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.UnsupportedOperationException</code> - if the graph is not a DAG (see <a href="../../../berack96/lib/graph/Graph.html#isDAG--"><code>isDAG()</code></a>)</dd>
</dl>
</li>
</ul>
<a name="stronglyConnectedComponents--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stronglyConnectedComponents</h4>
<pre>java.util.Collection&lt;java.util.Collection&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&gt;&gt;&nbsp;stronglyConnectedComponents()</pre>
<div class="block">The strongly connected components or disconnected components of an arbitrary directed graph
form a partition into subgraphs that are themselves strongly connected.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a collection containing the strongly connected components</dd>
</dl>
</li>
</ul>
<a name="subGraph-java.lang.Object-int-">
<!-- -->
</a><a name="subGraph-V-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>subGraph</h4>
<pre><a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;subGraph(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;source,
int&nbsp;depth)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Get a sub-graph of the current one based on the maximum depth that is given.<br>
If the depth is 1 then only the source and it's children will be in the sub-graph.<br>
If the depth is 2 then only the source, it's children and it's children of it's children will be in the sub-graph.<br>
And so on.<br>
Of course the sub-graph will contain the edges that link the vertices, but only the one selected.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the source vertex</dd>
<dd><code>depth</code> - the maximum depth (must be a positive number, if &gt;=0 a graph containing only the source is returned)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a sub-graph of the original</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the vertex is null</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not contained</dd>
</dl>
</li>
</ul>
<a name="subGraph-java.lang.Object...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>subGraph</h4>
<pre><a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&nbsp;subGraph(java.lang.Object...&nbsp;marker)</pre>
<div class="block">Get a sub-graph of the current one with only the vertex marked with the selected markers.<br>
Each vertex will have all his edges, but only the ones with the destination marked with the same marker.<br>
If the marker is not specified or is null then the returning graph will have all the vertices that are not marked by any marker.<br>
If the graph doesn't contain any vertex with that marker then an empty graph is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>marker</code> - one or more markers</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a sub-graph of the current graph</dd>
</dl>
</li>
</ul>
<a name="distance-java.lang.Object-java.lang.Object-">
<!-- -->
</a><a name="distance-V-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>distance</h4>
<pre>java.util.List&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&nbsp;distance(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;source,
<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;destination)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException,
java.lang.UnsupportedOperationException</pre>
<div class="block">Get the minimum path from the source vertex to the destination vertex.<br>
If the source vertex can't reach the destination, then an exception is thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the vertex where to start</dd>
<dd><code>destination</code> - the destination chosen</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an ordered list of edges from source to destination that represent the minimum path between the two vertices</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameter is null (except the consumer)</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not in the graph</dd>
<dd><code>java.lang.UnsupportedOperationException</code> - if from the source it's not possible to reach the destination</dd>
</dl>
</li>
</ul>
<a name="distance-java.lang.Object-">
<!-- -->
</a><a name="distance-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>distance</h4>
<pre>java.util.Map&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,java.util.List&lt;<a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph">Edge</a>&lt;<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>,<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">W</a>&gt;&gt;&gt;&nbsp;distance(<a href="../../../berack96/lib/graph/Graph.html" title="type parameter in Graph">V</a>&nbsp;source)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException</pre>
<div class="block">Get the minimum path from the source vertex to all the possible reachable vertices.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the vertex where to start</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a map containing all the possible reachable vertices from the source and the minimum path to reach them</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if one of the parameter is null (except the consumer)</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the vertex is not in the graph</dd>
</dl>
</li>
</ul>
<a name="save-berack96.lib.graph.Graph-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>save</h4>
<pre>static&nbsp;void&nbsp;save(<a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;?,?&gt;&nbsp;graph,
java.lang.String&nbsp;file)
throws java.io.IOException</pre>
<div class="block">Save the Graph passed as input to a file inserted as parameter.<br>
The resulting file is a Json string representing all the graph.<br>
If the directory for getting through the file do not exist,<br>
then it is created.<br>
For now the marks are not included.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>graph</code> - the graph to save</dd>
<dd><code>file</code> - the name of the file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - for various reason that appear in the message, but the most common is that the file is not found.</dd>
</dl>
</li>
</ul>
<a name="save-berack96.lib.graph.Graph-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>save</h4>
<pre>static&nbsp;void&nbsp;save(<a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;?,?&gt;&nbsp;graph,
java.lang.String&nbsp;other,
java.lang.String&nbsp;file)
throws java.io.IOException</pre>
<div class="block">Save the Graph passed as input to a file inserted as parameter.<br>
The resulting file is a Json string representing all the graph.<br>
If the directory for getting through the file do not exist,<br>
then it is created.<br>
For now the marks are not included.<br>
The additional parameter is used if you want to save other as well as the graph.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>graph</code> - the graph to save</dd>
<dd><code>other</code> - other things to save</dd>
<dd><code>file</code> - the name of the file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - for various reason that appear in the message, but the most common is that the file is not found.</dd>
</dl>
</li>
</ul>
<a name="load-berack96.lib.graph.Graph-java.lang.String-java.lang.Class-java.lang.Class-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>load</h4>
<pre>static&nbsp;&lt;V,W extends java.lang.Number&gt;&nbsp;java.lang.String&nbsp;load(<a href="../../../berack96/lib/graph/Graph.html" title="interface in berack96.lib.graph">Graph</a>&lt;V,W&gt;&nbsp;graph,
java.lang.String&nbsp;file,
java.lang.Class&lt;V&gt;&nbsp;classV,
java.lang.Class&lt;W&gt;&nbsp;classW)
throws java.io.IOException,
java.lang.NullPointerException,
com.google.gson.JsonSyntaxException</pre>
<div class="block">Load an already saved graph in an instance of a graph.
Before loading the graph, it is emptied.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V</code> - the parameter needed for the vertex</dd>
<dd><code>W</code> - the parameter needed for the weight</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>graph</code> - the graph to load with</dd>
<dd><code>file</code> - the file where the graph is saved</dd>
<dd><code>classV</code> - the class used for the Vertex</dd>
<dd><code>classW</code> - the class used for the Weight</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the string saved in other, if any</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - for any possible reason, the most common: the file doesn't exist</dd>
<dd><code>java.lang.NullPointerException</code> - if the graph is null</dd>
<dd><code>com.google.gson.JsonSyntaxException</code> - if the file is malformed or corrupted</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Graph.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../berack96/lib/graph/Edge.html" title="class in berack96.lib.graph"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../berack96/lib/graph/Vertex.html" title="class in berack96.lib.graph"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?berack96/lib/graph/Graph.html" target="_top">Frames</a></li>
<li><a href="Graph.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>