Greedy algorithm (greedy algorithm)-Algorithm learning Journey (i)

Source: Internet
Author: User

I studied the semester elective network management, because is limited to choose the class so I did not seriously class, today because the fast knot exam, I went, and then I found a big secret ...
The original teacher from the third class has begun to talk about algorithmic introduction of knowledge, I am not missing what ...

Don't say much nonsense, introduction greedy algorithm first popularize a basic prior knowledge of a theory

The diagram (Graphs) includes a forward graph and a non-direction graph.
Expressed as:
G= (v,e);
V is the vertex set, and E is the edge set.
The map (i,j) belongs to e,i-->j;
The non-direction diagram (I,J) belongs to E,i-–j;
| e| = O (| v|*| v|);

Representation of graphs 1. adjacency matrix

For g= (v,e); V = {12 ... N};
The matrix of N*n represents a for G, where a "i,j" = 1,if (i,j) belongs to E
0,if (I,J) does not belong to E

Above is an example

adjacency table

The adjacency Table of g= (v,e) consists of an array of adj, adj "V", V belonging to V, which contains all the points in the diagram that are adjacent to V.
For example:
Adj "i" ={2,3} indicates the point to be set from I

Minimum spanning tree problem

Using dynamic programming algorithms to solve

Dynamic programming algorithms need to meet the conditions # #

1. Optimal sub-structure
2. Overlapping sub-issues

Introduction to Prime Algorithms

Because of the mathematical symbols, I will not be handwritten.

Simple description

1. First select 5, and then the surrounding direct access points are marked on the right value, select the minimum weight of 6, and then 6 as the center, identify the direct link, if the weight than before the value of the update, 6 selected 2. Then 2 is the center, 2 is selected 1. Then look at the weight of the identity, in order from small to large

Greedy algorithm (greedy algorithm)-Algorithm learning Journey (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.