当前位置:网站首页>Online and offline problems
Online and offline problems
2022-07-06 06:12:00 【Zhan Miao】
1. Online questions
Not knowing all the instance information when making decisions , Decisions made cannot be changed after more information is presented .
2. Offline problems
Examples of all known problems before decision .
3. Online algorithms
You can process the input one by one in a serialized way , In other words, you don't need to know all the inputs at the beginning . Relative , For one Offline algorithm , Know all the data you need to enter at the beginning of the problem , And output the results immediately after solving a problem . for example , Selection sort Before sorting, you need to know all the elements to be sorted , However Insertion sort You don't have to .
Because the online algorithm does not know the whole input , So the choices it is forced to make may eventually prove to be suboptimal , The research on online algorithm mainly focuses on how to make a choice in the current environment . Online algorithms for the same problem and Offline algorithm The above viewpoint is formed by the comparative analysis of . If you want to know about online algorithms from other perspectives, you can take a look Stream Algorithm ( Focus on the amount of memory used to accurately present past inputs ), Dynamic algorithm ( Focus on what is needed to maintain an online input result Time complexity ) And online machine learning .
A good example of the concept of online algorithms is the Canadian Traveler Problem , The goal of this problem is to reach a target node with the least cost in a weighted graph , But some edges of this weighted graph are unreliable , May have been eliminated . However, a traveler can only determine whether an edge has been removed when he reaches an endpoint of that edge . In the worst case , The problem will become simple , That is, all uncertain edges are removed, and the problem will become common Shortest path problem .
4. Offline algorithm
Offline algorithm design strategies are based on the basic assumption that the input data is known before the implementation of the algorithm , in other words , For an offline algorithm , Know all the data you need to enter at the beginning of the problem , And output the results immediately after solving a problem , Usually, this kind of algorithm designed under the premise of complete information of the problem is called offline Algorithm .
reference
The concept of online algorithm and offline Algorithm - daiyl0320 - Blog Garden
边栏推荐
- How to use the container reflection method encapsulated by thinkphp5.1 in business code
- Digital triangle model acwing 1015 Picking flowers
- LeetCode 1200. 最小绝对差
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- 一文揭开,测试外包公司的真 相
- Grant Yu, build a web page you want from 0
- 浅谈专项测试之弱网络测试
- 二维码的前世今生 与 六大测试点梳理
- SQLMAP使用教程(三)实战技巧二
- 单元测试的意义
猜你喜欢
How Huawei routers configure static routes
Expose the serial fraudster Liu Qing in the currency circle, and default hundreds of millions of Cheng Laolai
异常检测方法总结
selenium源码通读·9 |DesiredCapabilities类分析
【Postman】测试(Tests)脚本编写和断言详解
Sqlmap tutorial (III) practical skills II
P问题、NP问题、NPC问题、NP-hard问题详解
Configuring OSPF GR features for Huawei devices
[eolink] PC client installation
调用链监控Zipkin、sleuth搭建与整合
随机推荐
把el-tree选中的数组转换为数组对象
数学三大核心领域概述:代数
C language bubble sort
LeetCode 739. 每日温度
假设检验学习笔记
A complete collection of necessary learning websites for office programmers
JDBC Requset 对应内容及功能介绍
[web security] nodejs prototype chain pollution analysis
Properties file
数字三角形模型 AcWing 1015. 摘花生
MySQL之基础知识
[postman] test script writing and assertion details
【C语言】字符串左旋
Luogu p1460 [usaco2.1] healthy Holstein cows
nodejs实现微博第三方登录
Application of Lie group in gtsam
Thoughts on data security (Reprint)
Reading notes of effective managers
Title 1093: character reverse order
Amazon Engineer: eight important experiences I learned in my career