ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1099. Work Scheduling

Страницы: 1 2 Следующая
Help me!
Послано Saturn 21 июн 2004 14:58
Can't you tell me how to solve this problem?
I have used both Blossom and BFS but WA(19).
The problem is VERY difficult (+)
Послано Dmitry 'Diman_YES' Kovalioff 21 июн 2004 22:27
Blossom is O(N^4), BFS is wrong in fact - and I don't know absolutely correct and fast algo... So, my solution is just BFS-based heuristics.
I used Gabow's algorithm. It work in O(n^3)
Послано Vladimir Yakovlev (USU) 21 июн 2004 22:37
Explain, please, or give the link (-)
Послано Dmitry 'Diman_YES' Kovalioff 21 июн 2004 22:50
Re: Explain, please, or give the link (-)
Послано Vladimir Yakovlev (USU) 21 июн 2004 22:56
Algorithm is not easy. I can send you a PDF.
Re: Explain, please, or give the link (-)
Послано Saturn 22 июн 2004 02:01
Please send me. My email is quangviet2004@yahoo.com
Thanks
Please, if it is not hard for you, send to me too. veselov@xaker.ru.
Послано Vlad Veselov [PMG17, Vinnitsa] 22 июн 2004 17:51
Send it to dimanyes@mail.ru, please (-)
Послано Dmitry 'Diman_YES' Kovalioff 22 июн 2004 18:50
Link
Послано Vladimir Yakovlev (USU) 23 июн 2004 01:10
You can download it from
http://dl.by.ru/upload/p221-gabow.pdf

Edited by author 23.06.2004 03:14
easy tests?
Послано mkd 23 июн 2004 01:43
To be fair with you I must admit that either the tests are easy or there's a much easier way to solve this problem. I used Berge's theorem (http://mathworld.wolfram.com/BergesTheorem.html) and I have AC (my C source is less than 1.5kB).
Re: easy tests?
Послано Vladimir Yakovlev (USU) 23 июн 2004 02:10
Gabow's algorithm also uses Berge's theorem. This theorem is basic in matching theory.

What method did you use?
Re: easy tests?
Послано mkd 23 июн 2004 04:35
My algorithm goes as follows:

do
  foundPath=false
  for i=1 to n do
  begin
    if exists augumenting path from vertex i then
    begin
      apply found path
      foundPath=true
    end
  end
while (foundPath)

Edited by author 23.06.2004 04:40
Re: easy tests?
Послано Vladimir Yakovlev (USU) 23 июн 2004 04:40
But how do you check if exists augumenting path?
Re: easy tests?
Послано mkd 23 июн 2004 04:44
I just use a DFS.
Thanks (-)
Послано Dmitry 'Diman_YES' Kovalioff 23 июн 2004 08:32
Re: easy tests?
Послано Vladimir Yakovlev (USU) 23 июн 2004 12:34
A simple DFS? Or something like random search?
Can you send me your source? See e-mail in my profile.
Re: easy tests?
Послано Saturn 23 июн 2004 13:40
Can you send it to me? Thanks
quangviet2004@yahoo.com
Re: easy tests?
Послано mkd 23 июн 2004 19:32
I can send it to everyone who already has Accepted - otherwise it would be unfair.

But I can give you my DFS:

int FindAndApply(int v)
{
  visited[v] = 1;
  for (PEdge t=out[v]; t != NULL; t = t->next) {
    int u = t->v;
    if (u == S[v]) continue;
    if (visited[u] || visited[S[u]]) continue;
    visited[u] = 1;
    if (S[u] == 0 || FindAndApply(S[u])) {
      S[u] = v;
      S[v] = u;
      return 1;
    }
  }
  return 0;
}


S[i] holds a vertex matched with vertex i.

Edited by author 23.06.2004 19:33
Re: easy tests?
Послано Vladimir Yakovlev (USU) 23 июн 2004 22:03
You can send it to anybody now becouse it doesn't work anymore ;-) I've added several new tests. All wrong methods (BFS, DFS, random search) won't pass these tests.
If your wrong program still can get AC now, please tell me.
Do you have an access to all the tests? If so I do not think it is a fair play (-)
Послано Dmitry 'Diman_YES' Kovalioff 23 июн 2004 22:28
Страницы: 1 2 Следующая