레이블이 computer science인 게시물을 표시합니다. 모든 게시물 표시
레이블이 computer science인 게시물을 표시합니다. 모든 게시물 표시

2015년 2월 5일 목요일

The App Developer Checklist: 6 Ways To Keep Your Users Happy


http://readwrite.com/2015/02/02/app-developer-checklist-features-performance

1. Win the Performance Race

In the world of mobile apps, speed sells. On-the-go users don’t want to wait for apps to load or updates to install, and they don’t care if an app’s sudden popularity creates a bandwidth bottleneck. They just want it to load quickly and work smoothly.
In worst-case scenarios, users simply delete poorly performing apps. In fact, according to a survey by Compuware, 59% say they would drag an app to the trash if it’s too slow. Others find ways around the app—for instance, some savvy Facebook and Twitter users find that the websites often outperformthose apps on speed and performance.

2. End Wild Goose Chases

When it comes to app design, less is more. Often times, apps that have beenpraised for their design are laid out logically and simply, and they perform how users expect them to. When users click on a menu, they have a reasonable idea of where they will end up, without having to guess where to find what they’re looking for. 
It’s critically important that developers get the design right. According to an EPiServer poll, as many as 47% of users will delete an app if it's too difficult to use. That’s exactly what many iPhone users did back in 2012, when the iOS 6 software came equipped with a “disaster” called Apple Maps. The app was so difficult to use and inaccurate that it even spawned the Tumblr page, “The Amazing iOS 6 Maps,” which collected screenshots of Apple Maps glitches. Many iPhone users turned to Google Maps and then stayed there.

3. Keep The Same Experience, No Matter The Device

Some users spring for in-app purchases in a tablet app—like a new game character or extra features—only to find that the upgrade doesn't carry over to the same app on their phones. Or they start listening to a podcast on an iPhone, only to waste time on the iPad version to find where they left off. 
A user should be able to easily jump back and forth between different versions of the same apps on different devices, without feeling like they are starting from scratch. Unfortunately, these types of performance problems are only going to become more prevalent and frustrating for users as more people switch between multiple devices. In fact, Cisco estimates that there will be 1.4 mobile devices per person by 2018. 
Switching devices should be easy—like changing lanes on a highway. You may be in a different lane, but you’re still on the same journey. App users crave that same type of experience, and it’s up to app developers to ensure that theuser journey stays consistent across devices. 

4. Banish Count Appula

According to AVG's CTO Yuval Ben-Itzhak, "Apps are what make a phone, but they’re also what break it." There's some truth to that. Apps create millions of different experiences for users, but that potential can be wasted if they're "vampire apps."
Vampire apps eat up battery life, rack up data charges and dramatically impact overall device and app performance. Users can take steps to mitigate those effects. They can reduce data usage and battery drain by turning off location services or by using Wi-Fi instead of mobile network services whenever possible. New apps like Normal, which crowdsources information about how apps deplete battery life, also help. But ultimately, it shouldn't be up to the consumer to make up for these failings. 
App developers need to find ways to minimize data usage and streamline processing to improve performance and battery life. 

5. Remember Murphy’s Law

If an app's function doesn’t perform as expected, users will be sure to zoom in on it. Some will complain about it to friends. Others will give the app a one-star review or even delete it altogether. 
Let’s say you have a car rental app. It displays all available vehicles' make, model and year in a beautiful map of your surroundings. That’s all very helpful—but what if, because of unreliable network connectivity, the app can't actually book it? Or a glitch stopped the confirmation email from coming through, leaving you unsure if the request was received. Sounds like a fairly minor failure, but it leaves users with no confidence in the app.  

6. Play Nicely with Other Apps

The apps with the richest performing experiences don't stubbornly trap users in one environment. Instead, they interact with each other, so users won't have to duplicate their actions or zigzag between stock apps—even if they do roughly the same thing.
For instance, Instagram users are probably happy that they can have all of their pictures automatically saved to the “Photos” application on their iPhone. They can apply Instagram filters before posting it on the network, or share the original, unedited versions with friends who don’t use Instagram. 
Strong app performance isn’t just about how an app functions in a vacuum—app developers have to think about how their app fits into the larger ecosystem, as this is how users will derive true value.

App-ortunity Knocks

If you could send a new iPhone 6 owner back in time to 1998 to play Snake, he or she wouldn’t describe the game as fast, easy to use, responsive, interactive or compatible with other apps. But as technology has evolved, so, too, have user expectations.
For developers to live up to them, they need to understand that optimal app performance hinges on how well data is managed on the back end. If app makers need to think about how they can apply intelligent data distribution to make apps more lightweight, they can ensure that the data traveling across the network isn’t redundant or out-of-date. 
The backend is invisible to users, so they may not know whether apps are designed using intelligent data distribution. But they will notice when apps don't perform as expected.  

Todoist Apple Watch App Demo

http://techcrunch.com/video/todoist-apple-watch-app-demo/518630539/

2015년 1월 2일 금요일

Everyone In Management Is A Programmer

http://techcrunch.com/2015/01/01/everyone-in-management-is-a-programmer/

Editor’s note: Adam Evans is the co-founder and CTO of RelateIQ.
When it comes to the task of finding and nurturing great engineering managers, misunderstandings at startups are all too common. It seems that many people assume great engineers don’t want to “give up” coding to take on leadership roles. To be clear, this is flat out wrong — and could create tremendous churn in your talent pool if you fail to recognize and elevate leaders in engineering as you would with any other team.
But, you might argue, engineers are introverted, right? And they would rather ponder big problems than worry about resource allocation? And they aren’t really interested in business problems as much as tech problems, correct?
The answer to all of these suppositions is “Not really.” All of these are just biases, or preconceived notions of what an engineer is like. We have some fantastically chatty engineers, and we have some quiet ones. We have some developers who would kill me if I asked them to do performance reviews, and some who genuinely enjoy coaching and mentoring as part of their jobs. It just depends.
Engineers, like all other teammates within your organization, run the gamut in terms of interest and proclivity for management roles. Some, I’ve found, just need a nudge to get there. They need you to frame the challenge in the right way to make it accessible to them.
So here’s my pitch to my engineering team: Anyone involved in management is aprogrammer. Being a leader within your organization requires you to master the art of motivating and coaching people, which isn’t all that different from, say, programming a person.
Sounds silly, I know, but think about it: As a programmer, your sole mission is to get a computer to do what you tell it to do — run the program the way you designed it to run. You spend all day trying to get that computer sitting across from you to follow your instructions. And it’s really stubborn. One bad keystroke and it doesn’t listen to anything you say. Maybe this metaphor is becoming more clear to anyone who has had a challenging direct report in the past.
There are major differences between programming computers and programming humans, of course, not the least of which is that some runtimes are much more volatile when you’reprogramming people.
Talking about programming humans really mimics how an engineer approaches a problem. Framing the management role in this way makes it instantly accessible, even to developers who never saw themselves enjoying management — and that’s something we can all agree is a welcome development.

2014년 10월 31일 금요일

First Look At 3D Camera App 3DAround

http://techcrunch.com/2014/10/24/3daround/?ncid=rss&cps=gravity


What if you could shoot those cool 360-degree, swivel-around photos you see on ecommerce sites or in The Matrix with just your smartphone? Then you’d be using the 3DAround camera app that launches next month from Dacuda, which gave TechCrunch an early peek. Simply hit record, revolve your camera phone or tablet around an object, and 3DAround stitches together all the photos into a 3D image the viewer can spin at will.
Dacuda is famous for its PocketScan appthat lets you wave your camera over a document to get a digital image of it without a bulky scanner. Now Dacuda’s 25-person team and 5 years of experience are combining to make your phone a 3D scanner that always gets the perfect angle…because it gets every angle. For starters, it’s going to add some 360-spice to a ubiquitous but often boring type of photography: food porn.
“It’s a really good time for this kind of tech because Apple just opened up the camera APIs” Dacuda founder and CTO Dr. Alexander Ilic tells me. “We need pretty low-level access to controlling exposure time, focus, and more.” That’s just what Apple allowed with iOS 8.
Illic says the inspiration for the app came from watching food blogger friends take dozens of photos of plates of grub from different angles and struggle to decide which was best. He thought “Why can’t you just go around the whole thing, so you don’t have to worry about the perfect shot with a single angle.” Originally he figured that would require a camera with expensive 3D sensors, but in fact, newer iPhones are capable if given the right software. That’s where Dacuda comes in.
Spun out of top Swiss engineering school ETH Zurich by students from the university and MIT, Dacuda’s expertise is in image stitching. It’s backed by Wellington Partners, Swiss bank Schwyzer Kantonalbank, and Austrian entrepreneur Hans-Peter Metzler.
Screen Shot 2014-10-24 at 1.05.03 PM
The 3DAround app extracts depth and structure information from a success of rapid-fire photos to create the 360-degree views. You’ll be able to interactively view the swivel-able photo through the 3DAround app or WebGL-equipped browsers like Chrome, and share some version of the images to Facebook, Twitter, and Pinterst
The app will launch for free next month on iOS 8 devices for the iPhone 5 on up. While some phones like the HTC EVO now have stereoscopic double cameras that can take slightly “3D” photos, 3DAround looks like the real deal. We’ll have hands-on coverage once the app launches, so check back to see us spinning around some delicious food.

2014년 10월 1일 수요일

Four Things You Need To Know About Windows 10

http://readwrite.com/2014/10/01/windows10-microsoft-new-features

Microsoft has finally shown the world its plans for its next major Windows release, the one that will succeed the much-maligned Windows 8. It's not Windows 9 or Windows Threshold—not even Windows One, as Microsoft executive VP of operating systems Terry Myerson briefly teased at one point during a presentation in San Francisco.

Meet Windows 10. Why is Microsoft skipping Windows 9? Your guess is as good as mine. More on that below.

The Big 10

The new operating system, which Microsoft is targeting for release by mid-2015, aims to correct many of the most criticized features of the Windows 8 desktop mode—the one most business users are familiar with. The colorful touch-oriented interface, which Microsoft calls the Modern UI, still exists, but didn't get much attention today. Microsoft promises more events at which it will talk about other Windows 10 features.

In general, one of Microsoft's big goals is to make it easy for users to move to Windows 10. That was a big problem for Windows 8, whose new and unfamiliar interface threw a lot of users.

"Windows 10 will be familiar to end users, whether they're coming from Windows 7 or Windows 8," Myerson said.

Here are four big takeaways from today's event.

The Start Menu Returns

In probably the biggest change from Windows 8, Windows 10 will bring back the Start Menu. That feature, a popup panel that gave access to installed programs and common features like the control panel, went missing in action in Windows 8. As long rumored, the new Start Menu will incorporate Modern-like tiles (see the above picture), some of which will display real-time information a la the current Modern interface.

Microsoft says the Start menu will be fully customizable. Users can change its shape and size, swap programs and other elements in and out, search for apps and even type in commands for which the operating system will then offer autocomplete options.

Desktops Go Virtual
Microsoft operating-system VP Joe Belfiore introduces virtual desktops
Microsoft operating-system VP Joe Belfiore introduces virtual desktops

Windows 10 will also feature "virtual desktops," which are collections of apps that users can rearrange for better multitasking. It's a reasonably easy concept to learn by messing around, although it's more difficult to describe.

In the photo above, Microsoft operating-system VP Joe Belfiore is pointing to four separate "desktops"—those little icons at the bottom of the screen. Each one features a distinct arrangement of different program windows, making it possible to group, say, various social-media apps in one, open files related to a particular project in another. Users will create, delete and switch between these desktops using a "task switcher" button next to the Start button.

Touch For Tablets, Keyboards For Desktops

Finally, Windows 10 is designed to switch between the desktop and the Modern touch interface depending on whether it detects an attached keyboard. This feature is apparently still under development, as Microsoft operating-system VP Joe Belfiore had to rely on a video instead of an actual product demo. He had previously warned that Windows 10 code is still early in development: "There will be rough spots, and things may go wrong," he said.

No One Can Explain The Name "Windows 10"

So, why name the new OS Windows 10? Myerson stumbled a bit as he tried to explain it during a Q&A with reporters:

Really, y'know, this is a, this product, when you see the product in its fullness, it's a more appropriate name for the breadth of the product family that's coming.... We have tested it with many people, and it was a name that resonated best for what we'll deliver.
ZDNet's Mary Jo Foley offered this translation: "It's going to be the last major version of Windows and Microsoft wanted to signify it will be a big and cross-platform release." In other words, 10 was a nice big round number, so why not skip the inferior "9" and move on?

That bit about the "last major version" of Windows, by the way, refers to the rumor that Microsoft is moving away from big "tentpole" releases toward a steady flow of smaller updates that have the effect of updating the OS in a more continuous fashion. Near as I can tell, Microsoft hasn't officially announced this plan yet, which might explain why Myerson was having trouble explaining the name.

Microsoft plans to release a technical preview build of Windows 10 to the public on Wednesday. You can start trying to download it at 9am PT at this link. I'll be grabbing it as soon as I can get through and will let you know more once I get my hands on it.

2014년 5월 12일 월요일

Arduino Vs. Raspberry Pi: Which Is The Right DIY Platform For You?

http://readwrite.com/2014/05/07/arduino-vs-raspberry-pi-projects-diy-platform#awesm=~oE6h9AF7F30qpf


Overview

Raspberry Pi and Arduino were both originally designed to be teaching tools, which is why they’ve become so popular—both devices are very easy to learn to use. 
Arduino, on the other hand, was born in Italy. It was named after the bar where inventor Massimo Banzi and his cofounders first forged the idea. Banzi, a teacher at the Interaction Design Institute Ivrea, wanted a simple hardware prototyping tool for his design students.Raspberry Pi hails from the United Kingdom. Inventor Eben Upton and his colleagues at the University of Cambridge’s Computer Laboratory were frustrated by the dwindling number of students, and the poor skill levels of those students, entering the program. Raspberry Pi was designed to be a cheap, hackable computer for improving tinkering skills. While Upton worked on prototypes from 2006 onward, the first shipment of Pis became available in April 2012.
As teaching tools, both Arduino and Raspberry Pi suitable for beginners. It’s only when examining their hardware and software that it becomes apparent they’re used for very different types of projects. 

Hardware And Software

Here’s an overview of some of the specs that show the biggest differences between the two:

Arduino Uno
Raspberry Pi Model B
Price
$30
$35
Size
7.6 x 1.9 x 6.4 cm
8.6cm x 5.4cm x 1.7cm
Memory 
0.002MB
512MB
Clock Speed
16 MHz
700 MHz
On Board Network
None
10/100 wired Ethernet RJ45
Multitasking
No
Yes
Input voltage
7 to 12 V
5 V
Flash
32KB
SD Card (2 to 16G) 
USB 
One, input only
Two, peripherals OK
Operating System
None
Linux distributions
Integrated Development Environment
Arduino
Scratch, IDLE, anything with Linux support
The price and size of the two devices are comparable; we already knew Raspberry Pi and Arduino were tiny and cheap. It’s the stuff inside that sets them apart.
The Raspberry Pi is 40 times faster than an Arduino when it comes to clock speed. Even more seemingly damning for Arduino, Pi has 128,000 times more RAM. The Raspberry Pi is an independent computer that can run an actual operating system in Linux. It can multitask, support two USB ports, and connect wirelessly to the Internet. In short, it’s powerful enough to function as a personal computer (though not powerful enough to compete with your Mac or PC). 
It might sound like Raspberry Pi is superior to Arduino, but that's only when it comes to software applications. Arduino’s simplicity makes it a much better bet for pure hardware projects. 
I asked Limor Fried, the founder of Adafruit, a DIY electronics store that offers parts and kits for both Arduino and Pi projects, about her expert opinion on their differences. An MIT educated engineer whose mission in life is to teach electronics to people of all skill levels, Fried knows both platforms better than most. 
“Arduino does have a 'real-time' and 'analog' capability that the Pi does not: This flexibility allows it to work with just about any kind of sensor or chips,” Fried said. “The Pi is not as flexible; for example, reading analog sensors requires extra hardware assistance. There are also thousands of tutorials on hooking an Arduino into just about every kind of part. On the other hand, the Pi benefits from decades of Linux software, so they're both great choices.”
Raspberry Pi can multitask processes—it can run multiple programs in the background while activated. For example, I have a Raspberry Pi that is serving as both a print server and a VPN server at the same time. The Arduino IDE is significantly easier to use than Linux. For example, if you wanted to write a program to blink an LED with Raspberry Pi, you’d need to install an operating system and some code libraries—and that’s just to start. On Arduino, you can get an LED light to blink in just eight lines of code. Since Arduino isn’t designed to run an OS or a lot of software, you can just plug it in and get started. 
On the other hand, you can leave an Arduino plugged in as it conducts a single process for a long time, and just unplug it when you’re not using it. This is why Fried would recommend the Arduino for beginners before she would the Pi:  
“The Arduino is simpler, harder to 'break' or 'damage' and has much more learning resources at this time for beginners,” Fried said. “With the Pi you have to learn some Linux as well as programming—such as Python. The Arduino works with any computer and can run off of a battery. You can also turn it on and off safely at any time. The Pi setup can be damaged by unplugging it without a proper shutdown.” 
While the Raspberry Pi shines in software application, the Arduino makes hardware projects very simple. It’s simply a matter of figuring out what you want to do. 

Working Together

The ultimate answer when deciding between the Pi and Arduino is, “Why choose?” If you’re looking to learn about electronics, each one will teach you something different.  
According to Fried, Raspberry Pi and Arduino are complementary. She suggested a scenario where the Arduino is the sensory workhouse, while the Pi doles out directions:
Author Simon Monk, who has written dozens of books on both Pi and Arduino, blogged a tutorial for getting Raspberry Pi to talk to Arduino in just a few lines of code. It makes use of a Python library, PySerial, that the Arduino foundation recommends as the easiest way to get computers to talk to Arduino. “They work great together,” Fried said. “The Arduino is best for motor driving, sensor reading, LED driving, etc while you can have an Internet-connected Pi drive it, a mini computer that can play videos, music or send emails with ease.”
Once you’ve got that down, the possibilities are infinite. You could homebrew beer, with the Arduino controlling the sensors and the Pi managing the brains of the operation. You could also create a platform for making robots that are much more capable than plain Arduino or Raspberry Pi bots.

Community

Both Raspberry Pi and Arduino have large, active communities surrounding them. Not only are they used in schools and universities, but also in hackerspaces worldwide. 
Here are some of the places you can visit to get Raspberry Pi support and project ideas:
Here are some of the places you can visit to get the same for Arduino:

2014년 4월 29일 화요일

Android SDK For Wearables Coming In 2 Weeks, Says Google

http://techcrunch.com/2014/03/10/wearable-android/


Google is readying a version of its Android OS tailored for wearable devices. Google’sSundar Pichai told the SXSW conferenceSunday that it would be releasing an SDK for makers of wearable devices such as smartwatches in two weeks’ time.
The SDK will be aimed at other makers of smartwatches and wearables, even though Google itself is thought to be working on building wearable hardware — with a Mountain View smartwatch project rumoured for months. (Last year Google confirmed it previously bought a smartwatch maker called WIMM Labs).
The release of Google’s smartwatch has been slated for either mid to late March, or pushed out to June (although the company has not confirmed its plans).
As with its mobile strategy, the spread of Android is Google’s primary concern here — with the wearable SDK allowing the services it offers packaged with Android to reach even further, via other makers’ hardware.
According to the WSJ, which reported the SDK announcement earlier, Pichai said Google is releasing its Android software developer kit for wearable devices well before actual devices hit the market so the company gets “plenty of feedback” first.
It’s possible Google is hoping to garner feedback for continued development of its own smartwatch device, as part of the SDK initiative.
It’s not just smartwatches Google has its eye on here either. The WSJ reports Pichai saying the company hopes its Android platform helps developers create many types of wearable devices — with Pichai apparently throwing out a sensor-laden, Android-powered “smart jacket” scenario as one possibility. 
The newspaper also notes Pichai was asked about Google’s recent acquisition of smart thermostat maker Nest Labs — and said Mountain View is thinking about creating a “mesh layer” of software to make its various devices work better together.

The Best Jobs Of 2014: Lots Of Math, Data And Code

http://readwrite.com/2014/04/28/best-jobs-2014-math-big-data-code-programming#awesm=~oCQnxHtmCYf1oN


Hate to break it to you, but if you want one of the best jobs you'll have to learn how to code. Or do complex math. Or decipher data. Or all of the above.
For those that already have these skills, your bank balance probably shows it. According to CareerCast's "Best Jobs of 2014" report, employers are paying big bucks to lure employees that understand data, code and math (which really translates to "data analytics"). In fact, jobs that depend on these geeky skills comprise half of the top 10 jobs of 2014.

Get Data Or Get Fired

Data analysis is so important to the modern enterprise, in fact, that one executive recruiter declared, "In 15 years, if you don't have a solid quant background, you might have a permanent pink slip," simply because "so much of decision-making in corporations is going so quickly toward having a quant foundation."
Scary? Yes. But also likely true.
Not everyone can be a "quant jock," of course. And as much as technology companies need engineers and data scientists, they also need English major-types to help craft a compelling narrative around their products. But more often, those that know data or code command the best jobs, which is measured in terms of environment, income, outlook and stress levels. 
Here are the top 10 jobs of 2014, along with the median income for the position:
  1. Mathematician / $101,360
  2. Tenured University Professor / $68,970
  3. Statistician /$75,560
  4. Actuary / $93,680
  5. Audiologist / $69,720
  6. Dental Hygienist / $70,210
  7. Software Engineer / $93,350
  8. Computer Systems Analyst / $79,680
  9. Occupational Therapist /$75,400
  10. Speech Pathologist / $69,870

Express Your Data In Code

Among the worst jobs of 2014 were the lumberjack (No. 200) and the newspaper reporter (No. 199). While it's unclear what the lumberjack should do, famed statistician Nate Silver offers clear guidance for journalists: Learn to code.
Silver oversees FiveThirtyEight, his news website, which will likely become 50% developers as "news" becomes far more than simple text. Journalism's future, he notes, is data visualization and interaction. This is one reason that software developer topped US News' 100 Best Jobs of 2014 report. The Bureau of Labor Statistics projects 22.8% employment growth for software developers between 2012 and 2022.
The importance of code, specifically code that helps enterprises process and analyze data, also shows up in Indeed.com's hottest job trends. Two of the top 10 technologies involve Big Data infrastructure, including Hadoop.
In a very real sense, developers write the future, app by app.

On The Job Training

If you're an enterprise in search of these high-paid data scientists and developers, you're in luck.
As Gartner analyst Svetlana Sicular posits, it's very likely you already have the right people in-house. You just need to train them:
[C]ompanies should look within. Organizations already have people who know their own data better than mystical data scientists...The internal people already gained experience and ability to model, research and analyze. Learning Hadoop is easier than learning the company’s business. 
And what do you do if you're the employee? Well, you can always learn to position yourself as a data scientist. It's a bit easier on the development side: You just need to download the relevant open source software—most of the essential Big Data technology is open source—and start hacking away.

SUMMARY; Time to get hacking on the right open source code.

2014년 4월 20일 일요일

Algorithm. Search Methods

http://blog.naver.com/mcjin02?Redirect=Log&logNo=80036338822

탐색의 개요

  • 문제 풀이는 대부분의 인공지능 응용에 있어서 기본이 되며, 사실상 문제를 풀이하는 능력은 인간과 기계에 대한 지능을 평가하는 측도로서 자주 사용
  • 두 가지 형태의 문제
    • 성공을 보장하는 결정적인 절차(procedure)를 사용함으로써 해결될 수 있는 문제. 이러한 절차는 계산(computation)이라고 부르며, 계산에 의한 풀이는 수학에서 그 절차가 존재하는 문제의 형태에 적용할 수 있으며 이와 같은 문제들을 풀기 위하여 사용되는 방법들은 컴퓨터가 실행할 수 있는 알고리즘의 형태로 변환 가능
    • 실세계의 문제들은 거의 계산적인 방법으로는 해결할 수 없기 때문에 탐색에 의하여 해를 구하는 문제. 인공지능으로부터의 접근이 필요
  • 탐색 방법의 성능을 평가 측도
    • 얼마나 빨리 해를 발견하는가 ?
    • 발견된 해가 얼마나 좋은 해(good solution)인가 ?

경로 발견

  • 경로를 발견하는 작업은 두 가지 종류의 노력
    • 임의의 경로나 가장 짧은 경로를 발견하는데 투자한 노력
    • 경로를 여행하는데 실질적으로 투자한 노력

탐색 방법

  • 망라적 탐색(blind search)
    • 사전에 정보가 제공되지 않은 경우
    • 초기 상태,연산자,목표 상태인지를 판정하기 위한 검사 이외에는 아무런 정보도 사용되지 않음
    • 사전에 예정된 순서나 무작위로 노드를 탐색하는 방법과 같이 조직적이고 체계적인 방법으로 진행

    • 너비 우선 탐색(breadth-first search)
      • 초기 노드에서출발하여 초기 노드의 모든 후계 노드, 즉 깊이 1인 모든 노드들을 탐색하고, 그 다음에는 깊이 2인 모든 노드 등의 순서로 탐색하여 목표 노드가 발견되거나 가장 깊은 노드가 탐색될 때까지 계속하여 탐색하는 방법
      • 알고리즘
        • 루트 노드를 큐(queue)에 넣는다.
        • 큐가 비거나 목표에 도달할 때까지 큐의 첫 번째 노드가 목표 노드인가를 조사한다.
          • 첫 번째 요소가 목표 노드이면 아무 것도 하지 않는다.
          • 첫 번째 요소가 목표 노드가 아니면 큐로부터 첫 번째 요소를 제거하고 그 자식들을 큐의 뒷부분에 첨가한다.
        • 목표 노드를 발견하면 성공, 발견하지 못하면 실패한다.
      • 만일 해가 존재한다면, 출발 노드에서 목표 노드까지 연산자의 적용 횟수를 최소로 하는 최단 경로(shortest length path)를 찾는 것을 보장. 즉, 최초로 찾아지는 해가 최단 경로를 갖는 해
      • 단점은 가지 수가 많거나 깊이가 깊은 그래프를 탐색할 경우, 검색해야 할 노드 수가 기하급수적으로 증가하여 메모리 공간을 많이 차지하기 때문에 비효율적

    • 깊이 우선 탐색(depth-first search)
      • 출발 노드로부터 시작하여 노드를 계속적으로 확장하고, 가장 최근에 생성된 노드를 먼저 확장시키는 탐색 기법
      • 만약 후계 노드가 없다든지, 어떤 노드의 모든 후계 노드를 방문했지만 목표 노드를 발견하지 못하였을 경우에는 즉각적으로 바로 직전 노드로 돌아감
      • 경우에 따라서는 해가 없는 경로를 계속해서 따라갈 수 있으므로, 필요에 따라 상위 노드로 되돌아가는 백트랙킹(backtracking)을 할 수 있는 방안를 마련 해야 함
      • 일반적으로 적당한 깊이 제한을 두어 어떤 노드가 그 이상의 깊이를 갖게 되면 이 노드를 더 이상 확장시키지 않고, 깊이 제한을 넘지 않는 것 중에서 가장 깊은(즉, 가장 최근에 생성된) 노드를 골라서 확장
      • 알고리즘
        • 루트 노드를 스택에 넣는다.
        • 스택이 비거나 목표에 도달할 때까지 스택의 첫 번째(top) 노드가 목표 노드인가를 조사한다.
          • 첫 번째 요소가 목표 노드이면 아무 것도 하지 않는다.
          • 첫 번째 요소가 목표 노드가 아니면 스택으로부터 첫 번째 요소를 제거하고 그 자식들을 스택의 앞부분(top)에 첨가한다.
        • 목표 노드를 발견하면 성공, 발견하지 못하면 실패한다.
      • 장점으로는 신속하게 원하는 목표를 찾을 수 있으며 구현하기가 용이하며 많은 가지들을 가지고 있는 상태 공간에서 매우 유용
      • 단점으로는 해가 없는 경로를 계속해서 탐색할 수 있기 때문에 통상적으로 깊이 제한을 두어 필요에 따라 전 노드로 되돌아갈 수 있는 백트랙킹이 요구
      • 최단 경로의 해를 반드시 구할 수는 없으나, 일반적으로 너비 우선 탐색 보다 효율이 좋음

    • 균일 비용 탐색(uniform-cost search)
      • 출발노트로부터의 경로비용이 최소인 노드를 선택하여 확장
      • 탐색과정에서 어떠한 노드 n을 확장시켜 m개의 후계노드가 생성될 경우 후계노드를 ni(i=1,2,...,m)라 할 때 ni의 경로비용
        • g(ni)=g(n)+C(n, ni)
        • g(n): 출발노드로부터 노드 n까지의 경로비용
        • C(n, ni): 노드 n에서 노드 ni로 이동하는데 소비되는 비용
      • 출발노드로부터의 경로비용이 최소인 노드가 먼저 확장되며, 따라서 이 과정에서 발견된 목표노드는 최소의 비용이 소요되는 경로
      • 탐색을 하기 전에 정보가 제공되지 않은 경우에는 너비 우선 탐색이나 깊이 우선 탐색과 같은 망라적 탐색방법을 시도. 이때 어떤 망라적 탐색 방법을 선택할 것인가는 목표 상태가 있을 법한 위치와 구하고자 하는 해의 성질에 따라 선택
      • 그다지 깊지 않은 곳에 해가 존재할 것 같은 경우에는 너비 우선 탐색이 가능하고, 해가 탐색 트리의 왼쪽편의 깊은 곳에 존재할 것 같은 경우에는 깊이 우선 탐색이 가능할 것. 최적해를 구할 경우에는 너비 우선 탐색을, 좋은 해라도 무방할 경우에는 깊이 우선 탐색을 시도
      • 망라적 탐색 방법은 소규모 문제에는 적용이 가능해도 대규모 문제에서는 조합에 의한 폭발이 발생하기 때문에 이를 해결하기 위하여 문제 고유의 휴리스틱(Heuristic)이 요구
      • 알고리즘
        • OPEN에 출발노드를 넣는다. 출발노드의 비용은 0이다.
        • OPEN에 노드가 남아 있는 동안 다음을 반복한다.
          • OPEN의 제일 앞에 있는 노드를 꺼내어 CLOSED에 넣는다.이 노드를 n이라고 한다.
          • 노드 n이 목표 노드라면 탐색은 성공적으로 끝난다. 포인터를 역으로 추적하면 탐색 경로를 얻을수 있다
          • 노드 n을 확장하여 후계노드 n1,n2,.....,ni을 생성한다. 이를 후계노드에 부모노드인 노드 n을 가리키는 포인터를 첨부한다.
          • 후계노드 n1,n2,..,ni의 경로비용을 계산한다.
          • 각각의 후계노드 nj,j=1,2,...,i에 대해 다음을 수행한다.
            • nj와 동일한 노드가 OPEN에 존재하고, 그 노드의 경로비용이 nj의 경로비용보다 크다면 그노드를 nj로 대치하고, 그렇지 않으면 nj는 무시한다.
            • nj와 동일한 노드가 CLOSED에 존재한다면 그 노드의 경로비용은 nj의 경로비용 보다 작다. 따라서 nj는 무시한다.
            • nj와 동일한 노드가 OPEN이나 CLOSED에 존재하지 않으면 nj를 OPEN에 첨가한다.
          • OPEN에 저장된 노드들을 경로비용의 오름차순으로 정렬한다.
        • 탐색은 실패로 끝난다.

  • 휴리스틱 탐색
    • 망라적 탐색 방법은 목표 노드까지의 경로를 찾는데 상당히 소모적. 원칙적으로 이 방법들은 경로를 찾는 문제에 대한 해를 제공하지만, 경로를 발견하기까지 너무 많은 노드를 확장시키므로 실용적이지 못한 경우가 많음
    • 많은 문제에서 탐색 작업을 축소시키기 위하여, 항상 옳은 것은 아니지만 대부분의 경우에 잘 맞는 경험에 의한 규칙(rules of thumb)들을 이용하는 경우가 많음. 이와 같은 정보를 사용하여 탐색 작업을 효율적으로 탐색을 진행시키는 방법을 휴리스틱 탐색 방법(heuristic search methods)이라고 부르며, 이때 사용되는 정보를 휴리스틱(heuristic)이라고 부름
    • 휴리스틱 정보는 비록 부정확하고 보장되지는 않지만, 빠르게 해를 발견하거나 최적인 해를 발견하거나 또는 둘 다를 만족할 수 있는 가능성을 증가 시킴
    • 휴리스틱 정보를 이용하는 탐색 방법들은 탐색 과정에서 노드들의 확장 순서를 정하기 위해 평가 함수(evaluation function)를 사용. 목적은 확장시킬 노드들에 순위를 매김으로써 어떤 것이 목표 노드까지의 최상의 경로에 있음직한가를 결정하는 것

    • 언덕 오르기 탐색
      • 목표 상태를 언덕의 꼭대기에 비유하고, 각 노드에서 언덕의 꼭대기에 가장 빨리 도달할 수 있는 다음 노드를 선택하는 방법을 언덕 오르기 탐색(hill climbing search)
      • 이 방법은 깊이 우선 탐색과 비슷한 방법으로 가장 유망한 자녀 노드를 선택. 자녀 노드들이 알려져 있을 때, 평가 함수를 사용하여 노드 선택을 위한 함수값을 계산. 함수값에 근거하여 최선의 노드를 선택하고 그 후에는 부모 노드나 자녀 노드에 대한 참고는 더 이상 하지 않음
      • 즉, 언덕 오르기 탐색을 통하여 트리를 확장하는 방법은 깊이 우선 탐색과 동일하지만, 목표까지 남아 있는 거리라는 휴리스틱에 따라 확장할 노드들에 대하여 평가값을 부여한 후 정렬
      • 목표 상태로 접근하는 방향으로 상태를 변화시킬 수 없는 경우가 발생하는데, 평가 함수의 값이 극대값이나 평원 혹은 산등성이에 도착했을 때 이러한 상태가 발생
        • 극대값(local maximum)은 인접한 근처의 모든 상태들보다도 원하는 목표 상태에 가깝지만, 멀리 떨어져 있는 다른 모든 상태들보다는 목표 상태에 가깝지 못할 경우인데 이 때는 백트랙킹이 필요하게 됨
        • 평원(plateau)은 인접한 상태들이 모두 같은 값을 갖는 탐색 공간의 평탄한 지역이며 국부적 비교를 이용하여 움직일 최적 방향을 결정하는 것이 불가능. 따라서 평원을 벗어나기 위한 연산자의 적용이 필요
        • 산등성이(ridge)는 주위 지역보다는 높지만, 하나의 움직임만으로는 어느 일정한 방향으로 탐색을 계속 수행할 수 없는 탐색 공간의 영역이므로 테스트할 방향의 수를 늘임으로써 이를 극복 가능
      • 신뢰할 만한 정보를 산출할 수 있는 함수에 의하여 전체적인 목적 노드를 찾기 위한 탐색을 잘 유도할 수 있다면 망라적 탐색 보다 훨씬 효율적
      • 알고리즘
        • 루트 노드를 스택에 넣는다.
        • 스택이 비거나 목표에 도달할 때까지 스택의 첫 번째 노드가 목표 노드인가를 조사한다.
          • 첫 번째 요소가 목표 노드이면 아무 것도 하지 않는다.
          • 첫 번째 요소가 목표 노드가 아니면 스택으로부터 첫 번째 요소를 제거하고 그 자식들을 평가된 남은 거리에 따라 정렬하여 스택의 앞 부분(top)에 첨가(push)한다.
        • 목표 노드를 발견하면 성공, 발견하지 못하면 실패한다.

    • 최적 우선 탐색(best-first search)
      • 지역적으로 확장된 트리의 모든 노드 중, 가장 좋은 노드부터 탐색을 시작
      • 산의 최고 지점을 찾기 위해 여러 팀이 협동하여 움직이는 것과 비슷
      • 기본적으로 우선 순위가 정해져야 하고, 많은 메모리가 필요하며 구현 방법이 복잡
      • 알고리즘 (알고리즘 설명상에서는 priority queue 자료구조를 이야기 하지 않는가 생각된다.)
        • 루트 노드를 큐(queue)에 넣는다.
        • 큐가 비거나 목표에 도달할 때까지 큐의 첫 번째 노드가 목표 노드인가를 조사한다.
          • 첫 번째 요소가 목표 노드이면 아무 것도 하지 않는다.
          • 첫 번째 요소가 목표 노드가 아니면 큐로부터 첫 번째 요소를 제거하고 그 자식들을 큐에 첨가한다.그리고 평가값에 따라 큐의 모든 요소를 정렬한다.
        • 목표 노드를 발견하면 성공, 발견하지 못하면 실패한다.

    • A* 알고리즘
      • 출발노드로부터 목표노드까지의 최적경로를 탐색하기 위한 것
      • 각각의 노드에 대한 평가함수를 정의
      • 알고리즘
        • 출발노드를 OPEN에 넣는다. 출발노드의 평가함수 값을 식에 따라 계산하면 된다.
        • OPEN에 노드가 남아 잇는 동안 다음을 반복한다.
          • OPEN에서 f값이 최소인 노드를 꺼내어 CLOSED에 넣는다. 이 노드가 n이라 한다. 만일 동일한 f값을 가지고 있는 노드가 여러 개 있을 때에는 임의로 선택하되 목표 노드가 있다면 우선적으로 선택한다.
          • 노드 n이 목표노드라면 타색은 성공적으로 끝난다.포인터를 역으로 추적하면 탐색경로를 얻을 수 있다.
          • 노드 n을 확장하여 후계노드 n1,n2,...ni를 생성한다.이들 후계노드에 부모노드인 노드 n을 가리키는 포인터를 첨부한다.
          • 각각의 후계노드에 대해 평가함수 f(n1),f(n2),...,f(ni)를 계산하여 첨부한다.
          • 각각의 후계노드 nk, k=1,2,.....,i에 대하여
            • 동일한 노드가 OPEN에 이미 존재한다면(그 노드를 n old라 하자)
              • f(n old)가 f(nk)보다 작다면 nk는 버린다
              • 그렇지 않으면, n old를 OPEN에서 제거한다.
            • 동일한 노드가 CLOSED에 이미 존재한다면(그 노드를 n' old라 하자)
              • f(n' old)가 f(nk)보다 작다면 nk는 버린다.
              • 그렇지 않으면 n'old의 부모포인터가 노드 n을 가리키도록 수정하고 평가함수를 f(nk)으로 수정한다.또한 n'old의 모든 후계노드에 대한 경로비용 g가 변화하였으므로 이를 수정한다.
            • 동일한 노드가 OPEN이나 CLOSED에 존재하지 않으면 nk을 OPEN에 삽입한다.
        • 탐색은 실패로 끝난다.
  • 8-퍼즐 문제의 탐색 예
    • 표현
      • 연산자 : UP, DOWN, LEFT, RIGHT
      • 제약 조건 : 한번에 한 칸씩 이동, 퍼즐의 내부에서만 이동
      • 목적 함수 : 현 상태와 목표 상태와의 차를 최소화
    • 너비 우선 탐색
    • 깊이 우선 탐색
    • 휴리스틱 탐색
      • 노드의 확장 순서를 결정하기 위해서는 노드의 가능성을 계산하는 방법이 필요
      • 평가 함수를 구하는 방법. 노드가 가장 우수한 경로 상에 있을 확률을 정의하거나, 노드와 목표 노드 사이의 거리 또는 차의 측도를 제안하거나, 또는 판을 사용하는 게임의 경우에는 목표를 향하고 있는 국면에 있는가 어떤가에 관한 특징에 따라 그 국면의 값을 정하거나 함
      • 간단한 평가 함수
        • f(n) = d(n) + w(n)
        • d(n)은 탐색 트리의 노드 n의 깊이, w(n)은 노드 n에 대한 잘못 놓여 있는 숫자판의 수
      • 만약 평가 함수의 값을 단순히 f(n) = d(n)으로 하면 너비 우선 탐색과 동일
      • 정말로 가능성이 있는 노드를 딘가에서 빠뜨리게 되는 평가 함수를 사용하면, 최소 비용의 경로를 얻을 수가 없고, 모든 노드에 대하여 도하게 평가하는 평가 함수(예를 들어 너비 우선 탐색으로 되는 평가 함수)를 사용하면 아주 많은 노드를 확장

  • 게임에서의 탐색
    • Babbage는 그의 수리 엔진(analytic engine)을 사용하여 체스를 두는 프로그램을 작성하려 했으며, 후에 삼목놀이(tic-tac-toe)를 하는 기계를 만듬
    • Shannon은 체스 프로그램에 사용될 수 있는 기법과 관련된 논문을 발표했으며, 몇 년 후 Turing은 체스 프로그램을 작성
    • 1960년대 초기에 Samuel에 의해 실제로 사용이 가능한 게임 프로그램이 처음으로 만들어졌으며, 이 프로그램은 단순히 체스를 두는 것 뿐만 아니라 실수를 깨닫고 수행 능력을 향상
    • 게임이 기계의 지능을 조사하기에 적합한 분야로 생각되는데는 두 가지 이유
      • 게임은 이기고 지는 것을 쉽게 알아낼 수 있는 구조화된 작업
        • 기계에 의한 게임 분야에 대해 계속적인 관심을 두는 것과 관련
      • 게임은 많은 양의 지식을 필요로 하지 않는다. 게임은 출발 상태로부터 승리의 상태를 찾는 탐색에 의해 해결될 수 있다고 생각되었다.
        • 단순한 게임을 제외한 어느 게임에도 적용되지 못함
        • 이유(체스 경우)
          • 평균 분기 계수는 35 정도이다.
          • 평균적으로 한 게임에서 경기자는 50수 정도를 둔다.
          • 따라서 완전한 게임 트리를 조사하기 위해서는 35100개의 위치를 조사해야 한다.
    • 단순히 게임 트리만을 탐색하는 프로그램은 상대방이 살아있는 동안 단 한 수도 두지 못할 것이 분명. 이를 해결하기 위해 일종의 경험적 탐색 방법이 필요
    • 탐색 과정의 기본적인 기법은 해답의 생성과 테스트
    • 다음 두 가지를 수행하여 탐색을 기초로 한 문제 풀이 프로그램의 효율성을 향상 시킬 수 있음
      • 적절한 움직임(경로)만을 만들도록 해답의 생성 과정을 향상시킨다.
      • 최적 움직임을 찾아 먼저 조사하기 위해, 테스트 과정을 향상시킨다.
    • 체스 문제로 살펴 보기
      • 매번 이용 가능한 움직임은 35개 정도
      • 만약 단순히 움직임만을 만드는 과정을 사용한다면, 테스트 과정(이 과정은 탐색과 경험적 지식에 사용되는 평가 함수를 적절히 결합하여 사용한다)에서 이들 각각을 조사
      • 이 경우 테스트 과정은 매우 많은 가능성을 조사해야 하기 때문에 엄청나게 빨리 수행. 따라서 테스트 과정은 수행되어야 할 일을 모두 정확하게 처리하지 못할 경우도 있음
      • 움직임만을 만드는 과정 대신, 이길 가능성이 있는 이동을 만들어 내는 과정(plausible move generator)을 사용하여, 유망한 몇 개의 움직임만을 선택하기 위해 경험적 지식을 사용하는 것이 더욱 더 중요. 이것은 체스 프로그램에서 특히 중요한 역할
      • 상당히 선택적인 움직임을 만들어 내는 테스트 과정을 사용할 경우, 주어진 각 움직임의 가치를 평가하기 위해 필요한 시간이 증가할 수 있음. 따라서 신뢰도가 높은 결과를 얻을 수 있음
      • 경험적 지식을 해답의 생성과 테스트 과정과 함께 결합하여 전체적인 시스템의 수행 능력을 향상시킬 수 있음
    • 문제에 대한 풀이를 찾기 위해 탐색 과정을 사용할 때 이상적인 방법은 목표 상태에 도착할 때까지 문제 공간 내에서의 움직임을 만들어 내는 것
    • 게임 프로그램의 목표 상태는 승리의 상태. 그러나 체스와 같은 게임의 경우, 비록 이길 수 있는 움직임을 효과적으로 만들어 내는 과정을 사용한다 하더라도, 목표 상태를 찾아 낼 때까지 탐색하는 것은 대체로 불가능.
    • 최적 움직임을 선택하기 위해서는 정적 평가 함수(static evaluation function)를 사용하여 만들어진 체스판의 위치를 비교함으로써 유망한 움직임을 찾음
    • 개개의 체스판 위치로부터 궁극적인 승리의 가능성을 추정하는 정적 평가 함수는 이용할 수 있는 모든 정보를 사용하여 각 체스판의 위치에 대한 가치를 평가
    • 유망한 움직임의 결과로 만들어진 체스판의 상태에 직접 정적 함수를 적용할 수도 있지만, 매우 효율적인 정적 평가 함수를 만든다는 것이 어렵기 때문에 가능한 한 게임 트리의 많은 레벨에 대하여 평가 함수를 적용하는 것이 좋음

    • MINIMAX 프로시저
      • 게임에서 판의 상황에 관한 모든 판단을 하나의 평가값으로 변환할 수 있는 상황 분석기(situation analyzer)를 가지고 있다고 가정. 그리고 편의상 평가값의 양수 값은 한 경기자가 유리함을 나타내고 음수 값은 다른 경가자가 유리함을 나타낸다고 가정. 유리함의 정도는 평가값의 절대값에 정비례
      • 정적 평가(static evaluation) : 평가값을 결정하는 프로시저
      • 이동 가능한 제한된 경로의 마지막 레벨에서 정적 평가기(static evaluator)라고 불리는 상황 분석기에 의해 만들어진 정적 평가값을 발견할 수 있음
      • 양수의 평가값을 원하는 경기자를 최대화 경기자(maximizing player), 그 상대방 경기자는 최소화 경기자(minimizing player)
      • 만약 최대화 경기자의 차례라면, 그는 가장큰 양수값으로 인도하는 경로를 찾을 것. 최대화 경기자는 그의 상대편은 가장 큰 음수값을 갖는 경로로 게임을 진행.
      • 게임 트리를 통하여 득점(scoring) 정보를 위의 노드로 전달하는 프로시저를 MINIMAX 프로시저라 하며 각 노드의 득점은 바로 아래 노드들의 득점들 중 최소값 혹은 최대값을 취한 것이기 때문.
        • 마지막 레벨에 도달했는가 혹은 해당 레벨이 최소화 레벨인지 아니면 최대화 레벨인지를 결정
        • 만약 마지막 레벨에 도달했다면 해당 경기자에게 해당되는 현재 위치의 정적 값을 계산하고 그 결과를 보고한다
        • 만약 최소화 레벨이면 현재 위치의 자식들에게 MINIMAX를 적용하고, 그 결과의 최소값을 보고한다.
        • 만약 최대화 레벨이면 현재 위치의 자식들에게 MINIMAX를 적용하고, 그 결과의 최대값을 보고한다.
      • 최대 최소 프로시저의 전체적인 아이디어는 게임의 판세를 단일 숫자인 정적 값으로 나타내는 사실에 있다는 점
      • 판세를 단일 숫자로 나타내는 것은 심각한 결점을 가지고 있다. 즉, 숫자가 어떻게 결정되었는가에 대하여 아무런 언급을 하지 않음
      • 최대 최소 프로시저는 경로를 특별한 정책없이 생성시키고, 정적 함수를 계산함으로써 비용이 듬. 이러한 비용은 사용되는 수 발생기(move generator)와 정적 평가기의 정교함에 따라 달라짐

    • ALPHA-BETA 프로시저
      • 우선 정적 평가기는 트리의 마지막 레벨에서 발견되는 각 상황에서 사용되어야 하는 것처럼 보일 수 있으나 다행스럽게도 그렇지는 않다. 생성되어야 할 트리의 가지 수와 정적 평가의 횟수를 줄이는 프로시저가 제안되어 있어, 트리의 마지막 레벨까지 따라가 보지 않고도 어떤 경로들이 나쁜가를 알아낼 수 있으며, 이를 위하여 탐색 전반에 걸쳐서 절단(cutting)이 이루어지고 있음
      • 키 원리(key principle)가 유용함은 명백
      • 만일 상대방의 잠재적 수(potential move)가 나쁜 반응을 하면 그 나쁜 수에 대한 다른 반응들을 검사할 필요가 없음. 나쁜 길에 대하여 얼마나 많은 길들이 있으며 얼마나 나쁜 경우가 있는지 발견할 필요가 없음.
      • 주어진 노드에서 바랄 수 있는 최선의 것에 대한 어떤 것이 발견될 때마다, 조상 노드에 대하여 무엇이 알려져 있는지 검사. 주어진 노드 아래를 더 이상 찾지 않아도 될 수 있음.
      • 한 노드의 정확한 값이 결정될 때마다, 부모에 대해 무엇이 알려져 있는지 검사. 부모 노드가 바랄 수 있는 최선의 값이 개선되거나 정확히 정해질 수 있음.
        [출처] 탐색(Search methods)|작성자 챙배