Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

# DirectedGraph

``` public class DirectedGraph ```
``` extends Object ``` ``` ```

A directed unweighted graphs implementation. The vertex type can be specified.

## Summary

### Public constructors

``` DirectedGraph() ```

### Public methods

``` void``` ``` addEdge(V from, V to) ```

Add an edge to the graph; if either vertex does not exist, it's added.

``` void``` ``` addVertice(V vertex) ```

Add a vertex to the graph.

``` boolean``` ``` contains(V vertex) ```

True if graph contains vertex.

``` boolean``` ``` isDag() ```

True if graph is a dag (directed acyclic graph).

``` void``` ``` removeEdge(V from, V to) ```

Remove an edge from the graph.

``` String``` ``` toString() ```

String representation of graph.

## Public constructors

### DirectedGraph

`public DirectedGraph ()`

## Public methods

```public void addEdge (V from,
V to)```

Add an edge to the graph; if either vertex does not exist, it's added. This implementation allows the creation of multi-edges and self-loops.

Parameters
`from` `V`

`to` `V`

`public void addVertice (V vertex)`

Add a vertex to the graph. Inop if vertex is already in graph.

Parameters
`vertex` `V`

### contains

`public boolean contains (V vertex)`

True if graph contains vertex. False otherwise.

Parameters
`vertex` `V`

Returns
`boolean`

### isDag

`public boolean isDag ()`

True if graph is a dag (directed acyclic graph).

Returns
`boolean`

### removeEdge

```public void removeEdge (V from,
V to)```

Remove an edge from the graph.

Parameters
`from` `V`

`to` `V`

Throws
`IllegalArgumentException` if either vertex doesn't exist.

### toString

`public String toString ()`

String representation of graph.

Returns
`String`

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"필요한 정보가 없음" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"너무 복잡함/단계 수가 너무 많음" },{ "type": "thumb-down", "id": "outOfDate", "label":"오래됨" },{ "type": "thumb-down", "id": "translationIssue", "label":"번역 문제" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"샘플/코드 문제" },{ "type": "thumb-down", "id": "otherDown", "label":"기타" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"이해하기 쉬움" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"문제가 해결됨" },{ "type": "thumb-up", "id": "otherUp", "label":"기타" }]