7    VisuAlgo.net / /dfsbfs Login 图遍历(DFS / BFS)
示例模式 ▿

>

>
go to beginning previous frame pause play next frame go to end

Given a graph, we can use the O(V+E) DFS (Depth-First Search) or BFS (Breadth-First Search) algorithm to traverse the graph and explore the features/properties of the graph. Each algorithm has its own characteristics, features, and side-effects that we will explore in this visualization.


This visualization is rich with a lot of DFS and BFS variants (all run in O(V+E)) such as:

  1. Topological Sort algorithm (both DFS and BFS/Kahn's algorithm version),
  2. Bipartite Graph Checker algorithm (both DFS and BFS version),
  3. Cut Vertex & Bridge finding algorithm,
  4. Strongly Connected Components (SCC) finding algorithms
    (both Kosaraju's and Tarjan's version), and
  5. 2-SAT Checker algorithm.

Remarks: By default, we show e-Lecture Mode for first time (or non logged-in) visitor.
Please login if you are a repeated visitor or register for an (optional) free account first.

Print this e-Lecture
X Esc
下一个 PgDn

When the chosen graph traversal algorithm is running, the animation will be shown here.


We use vertex+edge color (the color scheme will be elaborated soon) and occasionally the extra text under the vertex (in red font) to highlight the changes.


All graph traversal algorithms work on directed graphs (this is the default setting, where each edge has an arrowtip to indicate its direction) but the Bipartite Graph Check algorithm and the Cut Vertex & Bridge finding algorithm requires the undirected graphs (the conversion is done automatically by this visualization).


Pro-tip: Since you are not logged-in, you may be a first time visitor who are not aware of the following keyboard shortcuts to navigate this e-Lecture mode: [PageDown] to advance to the next slide, [PageUp] to go back to the previous slide, [Esc] to toggle between this e-Lecture mode and exploration mode.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

There are two different sources for specifying an input graph:

  1. Draw Graph: You can draw any unweighted directed graph as the input graph (to draw bidirectional edge (u, v), you can draw two directed edges u → v and v → u).
  2. Example Graphs: You can select from the list of our selected example graphs to get you started.

Another pro-tip: We designed this visualization and this e-Lecture mode to look good on 1366x768 resolution or larger (typical modern laptop resolution in 2017). We recommend using Google Chrome to access VisuAlgo. Go to full screen mode (F11) to enjoy this setup. However, you can use zoom-in (Ctrl +) or zoom-out (Ctrl -) to calibrate this.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

If you arrive at this e-Lecture without having first explore/master the concept of Binary Heap and especially Binary Search Tree, we suggest that you explore them first, as traversing a (Binary) Tree structure is much simpler than traversing a general graph.


Quiz: Mini pre-requisite check. What are the Pre-/In-/Post-order traversal of the binary tree shown (root = vertex 0), left and right child are as drawn?

In = 1, 0, 3, 2, 4
Pre = 0, 2, 4, 3, 1
Post = 1, 3, 4, 2, 0
In = 4, 2, 3, 0, 1
Post = 4, 3, 2, 1, 0
Pre = 0, 1, 2, 3, 4
Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We normally start from the most important vertex of a (binary) tree: The root vertex.


If the given tree is not 'rooted' (see the example picture), we can pick any one vertex (for example, vertex 0 in the example picture) and designate it as the root. If we imagine that all edges are strings of similar length, then after "virtually pulling the designated root upwards" and let gravity pulls the rest downwards, we have a rooted directed (downwards) tree — see the next slide.


PS: Technically, this transformation is done by running DFS(0) that we will explore soon.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

In a binary tree, we only have up to two neighboring choices: From the current vertex, we can go to the left subtree first or go to the right subtree first. We also have option to visit the current vertex before or after visiting one of the (or both) subtree(s).


This gives rise to the classics: pre-order (visit current vertex, visit its left subtree, visit its right subtree), in-order (left, current, right), and post-order (left, right, current) traversals.


Discussion: Do you notice that there are three other possible binary tree traversal combinations? What are they?

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

e-Lecture: The content of this slide is hidden and only available for legitimate CS lecturer worldwide. Drop an email to visualgo.info at gmail dot com if you want to activate this CS lecturer-only feature and you are really a CS lecturer (show your University staff profile).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

In a binary tree, or in a tree structure in general, there is no (non-trivial) cycle involving 3 or more distinct vertices to worry about (we do not consider the trivial cycle involving bi-directional edges which can be taken care of easily — see three slides earlier).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

In general graph, we do not have the notion of root vertex. Instead, we need to pick one distinguished vertex to be the starting point of the traversal, i.e. the source vertex s.


We also have 0, 1, ..., k neighbors of a vertex instead of just ≤ 2.


We may (or actually very likely) have cycle(s) in our general graph instead of acyclic tree,
be it the trivial one like u → v → u or the non-trivial one like a → b → c → a.


But fret not, graph traversal is an easy problem with two classic algorithms: DFS and BFS.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

One of the most basic graph traversal algorithm is the O(V+E) Depth-First Search (DFS).


DFS takes one input parameter: The source vertex s.


DFS is one of the most fundamental graph algorithm, so please spend time to understand the key steps of this algorithm.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

mazeThe closest analogy of the behavior of DFS is to imagine a maze with only one entrance and one exit. You are at the entrance and want to explore the maze to reach the exit. Obviously you cannot split yourself into more than one.


Ask these reflective questions before continuing: What will you do if there are branching options in front of you? How to avoid going in cycle? How to mark your own path? Hint: You need a chalk, stones (or any other marker) and a (long) string.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

As it name implies, DFS starts from a distinguished source vertex s and uses recursion (an implicit stack) to order the visitation sequence as deep as possible before backtracking.


If DFS is at a vertex u and it has X neighbors, it will pick the first neighbor V1 (usually the vertex with the lowest vertex number), recursively explore all reachable vertices from vertex V1, and eventually backtrack to vertex u. DFS will then do the same for the other neighbors until it finishes exploring the last neighbor VX and its reachable vertices.


This wordy explanation will be clearer with DFS animation later.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

If the graph is cyclic, the previous 'try-all' strategy may lead DFS to run in cycle.


So the basic form of DFS uses an array status[u] of size V vertices to decide between binary conditions: Whether vertex u has been visited or unvisited. Only if vertex u is still unvisited, then DFS can visit vertex u.


When DFS runs out of option, it backtrack to previous vertex (p[u], see the next slide) as the recursion unwinds.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

DFS uses another array p[u] of size V vertices to remember the parent/predecessor/previous of each vertex u along the DFS traversal path.


The predecessor of the source vertex, i.e. p[s] is set to -1 to say that the source vertex has no predecessor (as the lowest vertex number is vertex 0).


The sequence of vertices from a vertex u that is reachable from the source vertex s back to s forms the DFS spanning tree. We color these tree edges with red color.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

For now, ignore the extra status[u] = explored in the displayed pseudocode and the presence of blue and grey edges in the visualization (to be explained soon).


Without further ado, let's execute DFS(0) on the default example graph for this e-Lecture (CP3 Figure 4.1). Recap DFS Example


The basic version of DFS presented so far is already enough for most simple cases.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

The time complexity of DFS is O(V+E) because:

  1. Each vertex is only visited once due to the fact that DFS will only recursively explore a vertex u if status[u] = unvisited — O(V)
  2. Every time a vertex is visited, all its k neighbors are explored and therefore after all vertices are visited, we have examined all E edges — (O(E) as the total number of neighbors of each vertex equals to E).
Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

The O(V+E) time complexity of DFS only achievable if we can visit all k neighboring vertices of a vertex in O(k) time.


Quiz: Which underlying graph data structure support that operation?

Adjacency List
Adjacency Matrix
Edge List


Discussion: Why?

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

e-Lecture: The content of this slide is hidden and only available for legitimate CS lecturer worldwide. Drop an email to visualgo.info at gmail dot com if you want to activate this CS lecturer-only feature and you are really a CS lecturer (show your University staff profile).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

Another basic graph traversal algorithm is the O(V+E) Breadth-First Search (BFS).


As with DFS, BFS also takes one input parameter: The source vertex s.


Both DFS and BFS have their own strengths and weaknesses. It is important to learn both and apply the correct graph traversal algorithm for the correct situation.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

rippleImagine a still body of water and then you throw a stone into it. The first location where the stone hits the water surface is the position of the source vertex and the subsequent ripple effect across the water surface is like the BFS traversal pattern.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

BFS is very similar with DFS that have been discussed earlier, but with some differences.


BFS starts from a source vertex s but it uses a queue to order the visitation sequence as breadth as possible before going deeper.


BFS also uses a Boolean array of size V vertices to distinguish between two states: visited and unvisited vertices (we will not use BFS to detect back edge(s) as with DFS).


In this visualization, we also show that starting from the same source vertex s in an unweighted graph, BFS spanning tree of the graph equals to its SSSP spanning tree.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

Without further ado, let's execute BFS(5) on the default example graph for this e-Lecture (CP3 Figure 4.3). Recap BFS Example.


Notice the Breadth-first exploration due to the usage of FIFO data structure: Queue?

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

The time complexity of BFS is O(V+E) because:

  1. Each vertex is only visited once as it can only enter the queue once — O(V)
  2. Every time a vertex is dequeued from the queue, all its k neighbors are explored and therefore after all vertices are visited, we have examined all E edges — (O(E) as the total number of neighbors of each vertex equals to E).

As with DFS, this O(V+E) time complexity is only possible if we use Adjacency List graph data structure — same reason as with DFS analysis.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

So far, we can use DFS/BFS to solve a few graph traversal problem variants:

  1. Detecting if a graph is cyclic,
  2. Actually printing the traversal path,
  3. Reachability test,
  4. Identifying/Counting/Labeling Connected Components (CCs) of undirected graphs,
  5. Topological Sort (only on DAGs),

For most data structures and algorithms courses, the applications of DFS/BFS are up to these few basic ones only, although DFS/BFS can do much more...

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We can actually augment the basic DFS further to give more insights about the underlying graph.


In this visualization, we use blue color to highlight back edge(s) of the DFS spanning tree. The presence of at least one back edge shows that the traversed graph (component) is cyclic while its absence shows that at least the component connected to the source vertex of the traversed graph is acyclic.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

Back edge can be detected by modifying array status[u] to record three different states:

  1. unvisited: same as earlier, DFS has not reach vertex u before,
  2. explored: DFS has visited vertex u, but at least one neighbor of vertex u has not been visited yet (DFS will go depth-first to that neighbor first),
  3. visited: now stronger definition: all neighbors of vertex u have also been visited and DFS is about to backtrack from vertex u to vertex p[u].

If DFS is now at vertex x and explore edge x → y and encounter status[y] = explored, we can declare x → y is a back edge (a cycle is found as we were previously at vertex y (hence status[y] = explored), go deep to neighbor of y and so on, but we are now at vertex x that is reachable from y but vertex x leads back to vertex y).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

The edges in the graph that are not tree edge(s) nor back edge(s) are colored grey. They are called forward or cross edge(s) and currently have limited use (not elaborated).


Now try DFS(0) on the example graph above with this new understanding, especially about the 3 possible status of a vertex (unvisited/normal black circle, explored/blue circle, visited/orange circle) and back edge. Edge 2 → 1 will be discovered as a back edge as it is part of cycle 1 → 3 → 2 → 1 (similarly with Edge 6 → 4 as part of cycle 4 → 5 → 7 → 6 → 4).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We can use following simple recursive function to print out the path stored in array p. Possible follow-up discussion: Can you write this in iterative form? (trivial)

method backtrack(u)
if (u == -1) stop
backtrack(p[u]);
output vertex u

To print out the path from a source vertex s to a target vertex t in a graph, you can call O(V+E) DFS(s) (or BFS(s)) and then O(V) backtrack(t). Example: s = 0 and t = 4, you can call DFS(0) and then backtrack(4). Elaborate

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

If you are asked to test whether a vertex s and a (different) vertex t in a graph are reachable, i.e. connected directly (via a direct edge) or indirectly (via a simple, non cyclic, path), you can call the O(V+E) DFS(s) (or BFS(s)) and check if status[t] = visited.


Example 1: s = 0 and t = 4, run DFS(0) and notice that status[4] = visited.
Example 2: s = 0 and t = 7, run DFS(0) and notice that status[7] = unvisited.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We can enumerate all vertices that are reachable from a vertex s in an undirected graph (as the example graph shown above) by simply calling O(V+E) DFS(s) (or BFS(s)) and enumerate all vertex v that has status[v] = visited.


Example: s = 0, run DFS(0) and notice that status[{0,1,2,3,4}] = visited so they are all reachable vertices from vertex 0, i.e. they form one Connected Component (CC).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We can use the following pseudo-code to count the number of CCs:

CC = 0
for all u in V, set status[u] = unvisited
for all u in V
if (status[u] == unvisited)
CC++ // we can use CC counter number as the CC label
DFS(u) // or BFS(u), that will flag its members as visited
output CC // the answer is 3 for the example graph above, i.e.
// CC 0 = {0,1,2,3,4}, CC 1 = {5}, CC 2 = {6,7,8}

You can modify the DFS(u)/BFS(u) code a bit if you want to use it to label each CC with the identifier of that CC.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

Quiz: What is the time complexity of Counting the Number of CCs algorithm?

Trick question, the answer is none of the above, it is O(_____)
Calling O(V+E) DFS/BFS V times, so O(V*(V+E)) = O(V^2 + VE)
It is still O(V+E)


Discussion: Why?

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

e-Lecture: The content of this slide is hidden and only available for legitimate CS lecturer worldwide. Drop an email to visualgo.info at gmail dot com if you want to activate this CS lecturer-only feature and you are really a CS lecturer (show your University staff profile).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

There is another DFS (and also BFS) application that can be treated as 'simple': Performing Topological Sort(ing) of a Directed Acyclic Graph (DAG) — see example above.


Topological sort of a DAG is a linear ordering of the DAG's vertices in which each vertex comes before all vertices to which it has outbound edges.


Every DAG has at least one but possibly more topological sorts/ordering.


One of the main purpose of (at least one) topological sort of a DAG is for Dynamic Programming (DP) technique. For example, this topological sorting process is used internally in DP solution for SSSP on DAG.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We can use either the O(V+E) DFS or BFS to perform Topological Sort of a Directed Acyclic Graph (DAG).


The DFS version requires just one additional line compared to the normal DFS and is basically the post-order traversal of the graph. Try Toposort (DFS) on the example DAG.


The BFS version is based on the idea of vertices without incoming edge and is also called as Kahn's algorithm. Try Toposort (BFS/Kahn's) on the example DAG.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

As of now, you have seen DFS/BFS and what it can solve (with just minor tweaks). There are a few more advanced applications that require more tweaks and we will let advanced students to explore them on their own:

  1. Bipartite Graph Checker (DFS and BFS variants),
  2. Finding Articulation Points (Cut Vertices) and Bridges of an Undirected Graph (DFS only),
  3. Finding Strongly Connected Components (SCCs) of a Directed Graph (Tarjan's and Kosaraju's algorithms), and
  4. 2-SAT(isfiability) Checker algorithms.

Advertisement: The details are written in Competitive Programming book.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We can use the O(V+E) DFS or BFS (they work similarly) to check if a given graph is a Bipartite Graph by giving alternating color (orange versus blue in this visualization) between neighboring vertices and report 'non bipartite' if we ends up assigning same color to two adjacent vertices or 'bipartite' if it is possible to do such '2-coloring' process. Try DFS_Checker or BFS_Checker on the example Bipartite Graph.


Bipartite Graphs have useful applications in (Bipartite) Graph Matching problem.


Note that Bipartite Graphs are usually only defined for undirected graphs so this visualization will convert directed input graphs into its undirected version automatically before continuing. This action is irreversible and you may have to redraw the directed input graph again for other purposes.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We can modify (but unfortunately, not trivially) the O(V+E) DFS algorithm into an algorithm to find Cut Vertices & Bridges of an Undirected Graph.


A Cut Vertex, or an Articulation Point, is a vertex of an undirected graph which removal disconnects the graph. Similarly, a bridge is an edge of an undirected graph which removal disconnects the graph.


Note that this algorithm for finding Cut Vertices & Bridges only works for undirected graphs so this visualization will convert directed input graphs into its undirected version automatically before continuing. This action is irreversible and you may have to redraw the directed input graph again for other purposes. You can try to Find Cut Vertices & Bridges on the example graph above.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We can modify (but unfortunately, not trivially) the O(V+E) DFS algorithm into an algorithm to find Strongly Connected Components (SCCs) of a Directed Graph G.


An SCC of a directed graph G a is defined as a subgraph S of G such that for any two vertices u and v in S, vertex u can reach vertex v directly or via a path, and vertex v can also reach vertex u back directly or via a path.


There are two known algorithms for finding SCCs of a Directed Graph: Kosaraju's and Tarjan's. Both of them are available in this visualization. Try Kosaraju's Algorithm and/or Tarjan's Algorithm on the example directed graph above.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We also have the 2-SAT Checker algorithm. Given a 2-Satisfiability (2-SAT) instance in the form of conjuction of clauses: (clause1) ^ (clause2) ^ ... ^ (clausen) and each clause is in form of disjunction of up to two variables (vara v varb), determine if we can assign True/False values to these variables so that the entire 2-SAT instance is evaluated to be true, i.e. satisfiable.


It turns out that each clause (a v b) can be turned into four vertices a, not a, b, and not b with two edges: (not a → b) and (not b → a). Thus we have a Directed Graph. If there is at least one variable and its negation inside an SCC of such graph, we know that it is impossible to satisfy the 2-SAT instance.


After such directed graph modeling, we can run an SCC finding algorithm (Kosaraju's or Tarjan's algorithm) to determine the satisfiability of the 2-SAT instance.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

Quiz: Which Graph Traversal Algorithm is Better?

Always DFS
Always BFS
It Depends on the Situation
Both are Equally Good


Discussion: Why?

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

e-Lecture: The content of this slide is hidden and only available for legitimate CS lecturer worldwide. Drop an email to visualgo.info at gmail dot com if you want to activate this CS lecturer-only feature and you are really a CS lecturer (show your University staff profile).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

There are lots of things that we can still do with just DFS and/or BFS...

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

There are interesting questions about these two graph traversal algorithms: DFS+BFS and variants of graph traversal problems, please practice on Graph Traversal training module (no login is required, but short and of medium difficulty setting only).


However, for registered users, you should login and then go to the Main Training Page to officially clear this module and such achievement will be recorded in your user account.

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

We also have a few programming problems that somewhat requires the usage of DFS and/or BFS: Kattis - reachableroads and Kattis - breakingbad.


Try to solve them and then try the many more interesting twists/variants of this simple graph traversal problem and/or algorithm. You are allowed to use/modify our implementation code for DFS/BFS Algorithms that can be downloaded Here (ch4_01_dfs.cpp/java, ch4_04_bfs.cpp/java from the companion Competitive Programming book website).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

e-Lecture: The content of this slide is hidden and only available for legitimate CS lecturer worldwide. Drop an email to visualgo.info at gmail dot com if you want to activate this CS lecturer-only feature and you are really a CS lecturer (show your University staff profile).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn
当操作进行时,状态面板将会有每个步骤的描述。
Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

e-Lecture: The content of this slide is hidden and only available for legitimate CS lecturer worldwide. Drop an email to visualgo.info at gmail dot com if you want to activate this CS lecturer-only feature and you are really a CS lecturer (show your University staff profile).

Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

Control the animation with the player controls! Keyboard shortcuts are:

Spacebar: play/pause/replay
Left/right arrows: step backward/step forward
-/+: decrease/increase speed
Print this e-Lecture
X Esc
上一个 PgUp
下一个 PgDn

Return to 'Exploration Mode' to start exploring!


Note that if you notice any bug in this visualization or if you want to request for a new visualization feature, do not hesitate to drop an email to the project leader: Dr Steven Halim via his email address: stevenhalim at gmail dot com.

Print this e-Lecture
X Esc
上一个 PgUp

绘制图表

图示

Depth-First Search(s)

Breadth-First Search(s)

Topological Sort

Bipartite Graph Check

Cut Vertex & Bridge

SCC Algorithms

2-SAT Checker

>

CP3 4.1

CP3 4.3

CP3 4.4 DAG

CP3 4.9

CP3 4.17 DAG

CP3 4.18 DAG, Bipartite

CP3 4.19 Bipartite

s =

执行

s =

执行

DFS version

BFS version (Kahn's algorithm)

DFS version

BFS version

Kosaraju's Algorithm

Tarjan's Algorithm

Number of clauses = , Number of variables =

GO

关于 团队 使用条款

关于

VisuAlgo在2011年由Steven Halim博士概念化,作为一个工具,帮助他的学生更好地理解数据结构和算法,让他们自己和自己的步伐学习基础。
VisuAlgo包含许多高级算法,这些算法在Steven Halim博士的书(“竞争规划”,与他的兄弟Felix Halim博士合作)和其他书中讨论。今天,一些高级算法的可视化/动画只能在VisuAlgo中找到。
虽然专门为新加坡国立大学(NUS)学生采取各种数据结构和算法类(例如CS1010,CS1020,CS2010,CS2020,CS3230和CS3230),作为在线学习的倡导者,我们希望世界各地的好奇心发现这些可视化也很有用。
VisuAlgo不是从一开始就设计为在小触摸屏(例如智能手机)上工作良好,因为需要满足许多复杂的算法可视化,需要大量的像素和点击并拖动手势进行交互。一个令人尊敬的用户体验的最低屏幕分辨率为1024x768,并且只有着陆页相对适合移动设备。
VisuAlgo是一个正在进行的项目,更复杂的可视化仍在开发中。
最令人兴奋的发展是自动问题生成器和验证器(在线测验系统),允许学生测试他们的基本数据结构和算法的知识。这些问题是通过一些规则随机生成的,学生的答案会在提交给我们的评分服务器后立即自动分级。这个在线测验系统,当它被更多的世界各地的CS教师采用,应该技术上消除许多大学的典型计算机科学考试手动基本数据结构和算法问题。通过在通过在线测验时设置小(但非零)的重量,CS教练可以(显着地)增加他/她的学生掌握这些基本问题,因为学生具有几乎无限数量的可以立即被验证的训练问题他们参加在线测验。培训模式目前包含12个可视化模块的问题。我们将很快添加剩余的8个可视化模块,以便VisuAlgo中的每个可视化模块都有在线测验组件。
另一个积极的发展分支是VisuAlgo的国际化子项目。我们要为VisuAlgo系统中出现的所有英语文本准备一个CS术语的数据库。这是一个很大的任务,需要众包。一旦系统准备就绪,我们将邀请VisuAlgo游客贡献,特别是如果你不是英语母语者。目前,我们还以各种语言写了有关VisuAlgo的公共注释:
zh, id, kr, vn, th.

团队

项目领导和顾问(2011年7月至今)
Dr Steven Halim, Senior Lecturer, School of Computing (SoC), National University of Singapore (NUS)
Dr Felix Halim, Software Engineer, Google (Mountain View)

本科生研究人员 1 (Jul 2011-Apr 2012)
Koh Zi Chun, Victor Loh Bo Huai

最后一年项目/ UROP学生 1 (Jul 2012-Dec 2013)
Phan Thi Quynh Trang, Peter Phandi, Albert Millardo Tjindradinata, Nguyen Hoang Duy

最后一年项目/ UROP学生 2 (Jun 2013-Apr 2014)
Rose Marie Tan Zhao Yun, Ivan Reinaldo

本科生研究人员 2 (May 2014-Jul 2014)
Jonathan Irvin Gunawan, Nathan Azaria, Ian Leow Tze Wei, Nguyen Viet Dung, Nguyen Khac Tung, Steven Kester Yuwono, Cao Shengze, Mohan Jishnu

最后一年项目/ UROP学生 3 (Jun 2014-Apr 2015)
Erin Teo Yi Ling, Wang Zi

最后一年项目/ UROP学生 4 (Jun 2016-Dec 2017)
Truong Ngoc Khanh, John Kevin Tjahjadi, Gabriella Michelle, Muhammad Rais Fathin Mudzakir

List of translators who have contributed ≥100 translations can be found at statistics page.

致谢
这个项目是由来自NUS教学与学习发展中心(CDTL)的慷慨的教学增进赠款提供的。

使用条款

VisuAlgo是地球上的计算机科学社区免费。如果你喜欢VisuAlgo,我们对你的唯一的要求就是通过你知道的方式,比如:Facebook、Twitter、课程网页、博客评论、电子邮件等告诉其他计算机方面的学生/教师:VisuAlgo网站的神奇存在
如果您是数据结构和算法学生/教师,您可以直接将此网站用于您的课程。如果你从这个网站拍摄截图(视频),你可以使用屏幕截图(视频)在其他地方,只要你引用本网站的网址(http://visualgo.net)或出现在下面的出版物列表中作为参考。但是,您不能下载VisuAlgo(客户端)文件并将其托管在您自己的网站上,因为它是剽窃。到目前为止,我们不允许其他人分叉这个项目并创建VisuAlgo的变体。使用(客户端)的VisuAlgo的离线副本作为您的个人使用是很允许的。
请注意,VisuAlgo的在线测验组件本质上具有沉重的服务器端组件,并且没有简单的方法来在本地保存服务器端脚本和数据库。目前,公众只能使用“培训模式”来访问这些在线测验系统。目前,“测试模式”是一个更受控制的环境,用于使用这些随机生成的问题和自动验证在NUS的实际检查。其他感兴趣的CS教练应该联系史蒂文如果你想尝试这样的“测试模式”。
出版物名单
这项工作在2012年ACM ICPC世界总决赛(波兰,华沙)和IOI 2012年IOI大会(意大利Sirmione-Montichiari)的CLI讲习班上进行了简要介绍。您可以点击此链接阅读我们2012年关于这个系统的文章(它在2012年还没有被称为VisuAlgo)。
这项工作主要由我过去的学生完成。最近的最后报告是:Erin,Wang Zi,Rose,Ivan。
错误申报或请求添加新功能
VisuAlgo不是一个完成的项目。 Steven Halim博士仍在积极改进VisuAlgo。如果您在使用VisuAlgo并在我们的可视化页面/在线测验工具中发现错误,或者如果您想要求添加新功能,请联系Dr Steven Halim博士。他的联系邮箱是他的名字加谷歌邮箱后缀:StevenHalim@gmail.com。